我只想问,有没有办法使用jquery动态设置viewbag值?我在我的脚本中尝试此代码,
$(".btn").on("click",function(){
@ViewBag.Id = $(this).attr("id")
});
Run Code Online (Sandbox Code Playgroud)
我不知道它是否正确,但当我尝试运行我的MVC 3项目时,这个错误出现在我的firebug中
Syntax Error
= $(this).attr("id")
Run Code Online (Sandbox Code Playgroud)
请帮忙.谢谢