I'm working on a MVC3 app. In my action, I have ViewBag object that has either true or false value - I used breakpoint and can see that in the action, they have the correct values. Now, when I get to the view, I want to check these ViewBag object in jQuery Code:
if (@ViewBag.ind == true) {
$objKpr = $("[email protected]");
$objKpr.click();
}
When I tested own code with Firebug, it returned
if (False == false)
{
$objKpr = $("[email protected]");
$objKpr.click();
}
Viewbag was interpreted as a 'False' rather than a variable holding a value of false.Why is this happening?
Thanks for answers But the question was in another-Why a ViewBag inside a jQuery would not yield the correct value?