I am using razor template and following is the scenario
$(function(){
//if (ViewBag.IsCallFunction){
somefunction();
//
//do something else
});
If a viewBag variable is present, i.e. not null and if it is set to true, then I would like to call some javascript function. How do I do this?
but remember this will get called as rendered, as per OP, you can’t call it, you can render it, so call it inside document.ready when document is loaded