在客户端改变了asp.net标签文字是不是可以在web服务器的终端 [英] asp.net label text changed at the client is not available at the web server end
问题描述
我使用jQuery在客户端改变一个asp.net Label控件的文本。但是,当我在网络服务器(C#code)读取,它表明我是在UI(CSS)的设定值。是标签文本不控制状态的一部分吗?
I am changing an asp.net label control's text using jquery at the client. But when I read it at the webserver ( C# code ), it shows me the value that was set in the UI (aspx). Is label text not a part of the control state?
有没有办法迫使标签设置为控制状态的一部分(视图状态包含其他控件,如文本框的值)?
Is there a way to force the label to be a part of the control state (the viewstate contains the values of the other controls like the textbox) ?
推荐答案
标签不公布自己的值返回到Web服务器。一个标签基本上是跨越或标签标记。
您必须要么以及存储在一个隐藏的文本框的变化在标签
You have to either store the change in a hidden textbox as well as in the label
或
请一个文本框出现像造型标签那么值回发。
Make a textbox appear like a label in styling so the value posts back.
这篇关于在客户端改变了asp.net标签文字是不是可以在web服务器的终端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!