I need to call a jquery function on the view, using server side variable,
the variable are set in the viewbag without encoding the variables values.
eg.:
ViewBag.innerTitle = "<div id='title45'>My Title</div>"; //C#
$(function(){ alert(ViewBag.Title) }); // Js can I Access it
Personally, with that type of content I would be writing the html to the page, and just using jQuery, i.e.
Then the js is fixed, ideal for use on a static .js file that is downloaded and cached separately.
If you must write it to dynamic js:
but I would be nervous about single and double quotes.