I have an asp.net label web control. I change its text dynamically using jQuery .html() function. When I try to source the present value of a label on the server it displays the very original one from when the page loaded. Is there any way I could make the jQuery changes to the label permanent so I could source them on the server?
Share
You would need to mirror you JQuery changes into another control that will perist on the server side.
For example use a hidden field that is mared
runat="server"Shadow your change into this then this will persist on the server i.e. read the label change from the hidden fieldso
JQuery
Server Side
It’s not pretty but it’s the only way I’ve found of doing it.
JQuery doesn’t interact with
ViewStatehence any changes with JQuery are lost on postback. It’s one of the reasons I think that people are now going towards MVC. The postback architecture doesn’t play well with client side changes