I have a hidden field which i want to update everytime when my textbox value is changed. It doesnt matter whether i am changing value at server side or client side when the textbox value changes hidden field should be updated. I have used onchange event of textbox but it does not work as i am changing values of textbox programatically. How can i do this?
Share
You need to do it separately.
In the code behind you need to add in the
TextBox_TextChangedeventHiddenField.Value = TextBox.TextAnd in the client side you need to add the onchange event like
onchange="javascript:updateHiddenField();"and then do something like:Beware that if you use MasterPages or databinding controls like repeaters/gridviews etc then the ClientID won’t be the same as the ID.