阅读背景:

通过单一Qoute将字符串从MVC Razor传递到JavaScript

来源:互联网 

This seems so simple it's embarrassing. However, the first question is when passing a value from the new ViewBag in MVC 3.0 (Razor) into a JavaScript block, is this the correct way to do it? And more importantly, where and how do you apply the proper string replacement code to prevent a single quote from becoming &#39 as in the resultant alert below?This seems so simple it's embarrassing. However




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

分享到: