I have a GridView with a Label. The value of the Label can be calculated with a
jQuery-Method. When doing this, the (.Net-)server does not realise the change of the label, but works with the old value from the database.
I tried several approaches to fix it:
- a TextBox behaving like a label doesn´t change anything
- HiddenField: does´nt work because it has´nt a CssClass-property. I cannot raise the
ID of the HiddenField because I want to put it in the GridView, and don´t know how
to get the HiddenField in the jQuery-Method
The only way it works is with an empty TextBox, but it needs to be visible to get
the text, in my experience. I do not want this.
Please give me advice and clear up, if I misunderstand something
I’d still use a hidden field for this, who cares that the ASP.Net team didn’t give it a CssClass property 🙂
It works, just isn’t a property on the server control, it behaves like any attribute.
Alternatively, use the ends with selector to find it: