如何在ASP.NET中将JavaScript变量用于aspx.cs代码 [英] How to use javascript variable into aspx.cs code in ASP.NET

查看:59
本文介绍了如何在ASP.NET中将JavaScript变量用于aspx.cs代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在ASP.NET中的aspx.cs代码中使用javascript变量.

想要在asp.net中的ASPX.CS文件中使用javascript变量值.

谢谢,
Mangesh:-)

How to use javascript variable into aspx.cs code in ASP.NET.

Want to use javascript variable value into ASPX.CS file in asp.net.

Thanks,
Mangesh :-)

推荐答案

这取决于您要如何使用变量.您可以通过Ajax调用(例如使用Page方法)传递javascript变量.您可以将变量作为查询字符串传递.您可以使用具有runat = server属性的任何HTML元素,这些属性将在代码后在您的代码中创建一个GenericHtml对象.
it depends on how you want to use the variable. You could pass a javascript variable via an Ajax call, such as using a Page Method. You could pass the variable as a query string. You could use any HTML element that has the runat=server attribute which will create a GenericHtml object in you code-behind


您好,Mangesh


http://forums.asp.net/p/1211504/2139016.aspx#2139016 [ ^ ]

检查此链接,
Hi Mangesh


http://forums.asp.net/p/1211504/2139016.aspx#2139016[^]

check this link,


您好,

您可以在Java脚本中设置hidden字段的值,然后在aspx.cs页面中访问该值,

可以试试这个……
Hello,

you can set the value of hidden field in java script and then access that value in aspx.cs page,

can try this......


这篇关于如何在ASP.NET中将JavaScript变量用于aspx.cs代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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