阅读背景:

将模型分配给Razor中的一个Javascript变量

来源:互联网 

I have a strongly-typed view bound to an object which contains a Collection (list) of some objects. I know Razor gets executed on the server-side when it's generating the page, whereas Javascript variables don't get instantiated until after the page is displayed... but would it somehow be possible to convert the Model (that the view is bound to) or any of its fields to JSON in Razor without resorting to an AJAX call to fetch that data afterwards?I have a strongly-typed view bound to an object




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: