I need pass ViewBag value to java script function in razor. ViewBag filled by string and I use this code but get error that :
Uncaught ReferenceError: IsAirTour is not defined
IsAirTour is value of ViewBag
var RunFilter = function (cls) {
var $grid = $('#grid');
$grid.isotope({ filter: '.' + cls + '' })
SetHeightEls('#grid .All');
}
$(document).ready(function () {
RunFilter(@((string)ViewBag.Cls) ); //Error
});
How to solve this?