想要从aspx页面将变量值传递给javascript [英] want to pass a variable value to javascript from aspx page
本文介绍了想要从aspx页面将变量值传递给javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个名为EmployeeName的变量,我想将此值传递给Javascript.意味着我想将值传递给Javascript函数.谢谢Ravi
hi i have a varaible called EmployeeName, i want to pass this value to Javascript. Means i want to pass the value to Javascript Function. Thanks Ravi
推荐答案
在调用javascript时在代码后面添加此代码.
Add this in code behind wher you are calling javascript.
string func = "Javascriptfunction('"+EmployeeName+"');";
ClientScript.RegisterStartupScript(this.GetType(), "success", func, true);
如有疑问,请参考此链接
http://www.devcurry.com/2009/01/execute-javascript- function-from-aspnet.html
Refer this link if have any doubt
http://www.devcurry.com/2009/01/execute-javascript-function-from-aspnet.html
^ ]
http://bytes.com/topic/asp-net/answers/602083-paasing-values-javascript-asp-net [ ^ ]
http://forums.devshed.com/javascript-development-115/how-to-pass-asp-net-variables-to-javascript-function-109149.html[^]
http://bytes.com/topic/asp-net/answers/602083-paasing-values-javascript-asp-net[^]
这篇关于想要从aspx页面将变量值传递给javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文