没有回发我想获得客户端价值? [英] without postback i want to get client side value?

查看:94
本文介绍了没有回发我想获得客户端价值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个隐藏的字段

Hi,

I have a hidden field

<asp:HiddenField runat="server" ID="hdnRow" />

<我的aspx页面中有
。使用javascript在客户端点击按钮,在

中将值添加到此隐藏字段中。我想在没有回发的情况下获得服务器端隐藏字段的值

。如何获得隐藏的字段值?



是否可以使用ajax?



谢谢..


in my aspx page. adding values into this hidden field in
a button click at client side using javascript. i want to get the values
of hidden field in server side without postback. how to get the hidden field value?

is it possible using ajax?

thanks..

推荐答案

是的,可以使用Ajax Async Postback。

你可以简单地将Button放在Ajax Update面板中并以异步方式回发它而不用回页整页。



其次,您可以使用jQuery异步调用服务器端方法并在调用服务器端方法时传递隐藏字段值并捕获此值在你的服务器端方法。



所以,如果你知道如何实现这两种技术,那么我相信你可以得到你的解决方案。
Yes It''s possible with Ajax Async Postback.
You can simply place the Button inside Ajax Update panel & postback it Asynchronously without posting back the whole page.

Secondly you can use jQuery to call Server side method Asynchronously & just pass the Hidden filed value while calling the Server side method & catch this value in your Server side method.

So if you know how to implement these 2 techniques then I''m sure you can get your Solution.


将隐藏字段放在更新面板中以获取服务器端的值。
Put the hidden field in in Update Panel to get the value at server side.


这篇关于没有回发我想获得客户端价值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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