HtmlInputHidden[Resolved]
I have created a user control. For each text box in the user control, I have created onTextChange event which is true if the user fills out any text box. I have a HtmlInputHidden field which usually is set to False but once the user start entering data, it is set to True. If the user clicks return to return back, I have added code to ask the user if they want to store the data. The pop up is done using the javascript code. If the user decides to continue, I change the value of the HtmlInputHidden field to false, and call the button's onclick event. The problem here is that even though I use the following code to change the value, it still shows true in the button's onclick event. If I click the button again, then it knows the value has been changed and it returns back to the previous page.
Code:
document.getelementbyid('UserControl_HTMLHiddenfield).value = "False";
Can someone tell me what could be the reason? Thanks in advance
Re: HtmlInputHidden[Resolved]
This issue is solved. Basically on the behind code I did this
Code:
btnReturn.Attributes.Add("onClick", "return fnRetFunction()");
and in the fnRetFunction has a confirm and return true or false based on what the user has clicked. If the user clicked cancel, then btnReturn onclick event is not fired.