如何在webmethod中访问隐藏字段值? [英] how to access hidden field value in webmethod?

查看:95
本文介绍了如何在webmethod中访问隐藏字段值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我想访问webmethod中的隐藏字段值,这是应用程序中的全局值。如果我通过参数传递它会让我... ..但在代码背后我总是得到旧值。



请建议

Hi ,

i want to access hidden field value in webmethod which is global in the application. if i pass it via parameter it will aloow me .. but in code behind i always get old value only .

please suggest

推荐答案

Web方法可用于两个目的





您将无法获得隐藏的更新值web方法中的字段,因为Web方法在服务器中运行,服务器不知道在回发之前在客户端完成的值更改。



如果您的Web方法的目的是AJAx Call,

你可以在ajax调用中发送hiddenfiled的更新值作为参数值。













-shazid
Web Method can be used for Two purpose


You won't get the updated value of Hidden field in web method because web method run in the server and server doesn't aware about value changes done in client side before Postback.

if your purpose of web method is AJAx Call ,
you can send the updated value of hiddenfiled as a parameter value in ajax call.






-shazid


这篇关于如何在webmethod中访问隐藏字段值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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