user control on webform
-
i have devexpress ASPxMenu control on my form and also other controls like textbox,button etc. If the user changes the text in the textbox and clicks the menu control i would like to prompt the user through javascript or server side coding that he has not saved his changes and moving on to other form. I tried with ajax update panel but that update panel use to get postback on textchanged event of textbox .So if I change textbox contents and press save button then it use to postback the form without the code for click of button getting executed. Can this be done through javascripting?
-
i have devexpress ASPxMenu control on my form and also other controls like textbox,button etc. If the user changes the text in the textbox and clicks the menu control i would like to prompt the user through javascript or server side coding that he has not saved his changes and moving on to other form. I tried with ajax update panel but that update panel use to get postback on textchanged event of textbox .So if I change textbox contents and press save button then it use to postback the form without the code for click of button getting executed. Can this be done through javascripting?
bhavna4321 wrote:
Can this be done through javascripting?
Yes. You need to keep a flag which sets when value changes in the text box. Hook a JS function on the OnUnload event and check this flag's status. If it is set, display the prompt.
Best wishes, Navaneeth
-
bhavna4321 wrote:
Can this be done through javascripting?
Yes. You need to keep a flag which sets when value changes in the text box. Hook a JS function on the OnUnload event and check this flag's status. If it is set, display the prompt.
Best wishes, Navaneeth
how ???
-
i have devexpress ASPxMenu control on my form and also other controls like textbox,button etc. If the user changes the text in the textbox and clicks the menu control i would like to prompt the user through javascript or server side coding that he has not saved his changes and moving on to other form. I tried with ajax update panel but that update panel use to get postback on textchanged event of textbox .So if I change textbox contents and press save button then it use to postback the form without the code for click of button getting executed. Can this be done through javascripting?
bhavna4321 wrote:
Can this be done through javascripting?
The answer, as you've been told, is yes. It's really easy. Perhaps you should buy a javascript book and read it ? There's an event that fires if your textbox text changes, when that fires, you set your flag and you check it in the event, as you were told.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
i have devexpress ASPxMenu control on my form and also other controls like textbox,button etc. If the user changes the text in the textbox and clicks the menu control i would like to prompt the user through javascript or server side coding that he has not saved his changes and moving on to other form. I tried with ajax update panel but that update panel use to get postback on textchanged event of textbox .So if I change textbox contents and press save button then it use to postback the form without the code for click of button getting executed. Can this be done through javascripting?
Do you only need to prompt a meassage or it should disallow user to navigate to another page ???