I have a master page and a $(document).ready() handler in it. Depending on the actual page that will be rendered the ViewBag.Post will either be ‘true’ or ‘false’. If it is set to true I will perform an AJAX operation when the handler is triggered, otherwise not. But the ViewBag cannot be called inside javascript code, or is it?
How else can this be achieved?
in document ready method u can write it like