c# - Unable to access property using MVC3 Razor -


i want access property

public string gridhtml { get; set; } 

that have defined in controller. trying access property using javascript, mvc3 razor this

$(document).ready(function() {     var str = @model.gridhtml ; } 

but getting error above variable not defined. can me. in advance.

if have passed model correctly following should work, unless razor syntax not residing inside separate js file

$(document).ready(function() {     var str = '@:model.gridhtml';    console.log(str); } 

Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -