I want to access the property
public string gridHTML { get; set; }
that I have defined in my controller. I am trying to access this property using the JavaScript, MVC3 Razor
like this
$(document).ready(function() {
var str = @Model.gridHTML ;
}
but i am getting the error that the above variable is not defined. Can anybody help me. Thanks in advance.
if you have passed the model correctly then the following should work, unless the razor syntax is not residing inside a separate
jsfile