从javascript设置ViewBag属性 [英] Setting ViewBag property from javascript

查看:71
本文介绍了从javascript设置ViewBag属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI,任何人都知道如何在javascript中设置ViewBag属性吗?我正在使用此代码



can any one know how to set ViewBag property in javascript? I am using this code

@{
    ViewBag.Pid = @:Pid
}





其中@:Pid是javascript变量并且有值,但是代码不起作用并且给出了语法错误。



where @:Pid is javascript variable and have value in it, but the code is not working and giving syntax error.

推荐答案

请查看以下网址

http://stackoverflow.com/questions/8539487/how-to-set-a-javascript-variable-from-my-view-using-a -viewbag-property [ ^ ]
Please check below url
http://stackoverflow.com/questions/8539487/how-to-set-a-javascript-variable-from-my-view-using-a-viewbag-property[^]


请参阅..

http://stackoverflow.com/questions/11948620/setting-up-the-value-in-viewbag -using-jquery [ ^ ]


这篇关于从javascript设置ViewBag属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆