I’m finding some difficulties using JQuery on ASP.NET pages. In particular I have two main problems. I need to change the value of a Label and of a DropDownList using JQuery, then I have to read this values from code behind, but when I do it I find the original values. Changes made on client side are ignored.
How can I read correct values on server-side?
Instead of using label and dropdown list to set the values,use Hiddenfield to set the value and then at the code behind get that value using HiddenField.Value.In most of the cases it is seen that Label and DropdownLists values which are set in Javascript code cannot be retrieved in code behind,but HiddenField Values can be retrieved.So try using HiddenField…
In Javascript:-
In CodeBehind:-