开发者

Get element text before page reloads in ASP.net web forms

I am unfortunately having to work with asp.net web forms. I have a label that has a different Text property every time the page loads. I have a button that is clicked. I have double clicke开发者_如何学Pythond on the button and it has shown me a code view.

I get a reference to the label via labelID.Text, but it refers to the value of the text that is about to be displayed on the next page load. How would I get the text of the value when the button was actually clicked? Or is web forms not advanced enough for that.


Search where the labelID.Text is modified (maybe Page_Load event), and save the text before in a global variable.


It sounds like on every page load or postback, somewhere there is code which applies a new value to labelID.Text. Where is that work being done? Page_Load?

In any case, wherever that work is being done, you most likely have access to both the existing text value of the control, and the new text value you're about to give it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜