I have a WebDialogWindow with several controls. It is on a page that is not the start page. When a user types information into a control in the dialog window and then presses 'Enter' the dialog is closed and the user is returned to the start page of the application. Has anyone seen this before?
Hello Peggy,I have created a sample reproducing your scenario. Sample has Default page which contains a hyperlink redirectin you to Second page. On Second page there are a WebDialogWindow containing three TextBox controls in it. I tried the following:1. Start the sample which loads Default page.2. Click on the hyperlink which redirects me to the Second page
3 Type something inside any of the TextBoxes and press Enter4 Nothing happened – I was not redirected on the Default page.Please take a look at the sample and modify it or create a new one reproducing the behavior you are facing. I used for test IE 9 – please point if this issue is occuring in some other browser or version. Looking forward to hearing from you.
I have discovered the issue. My application has an image button at the top of the master page whose click event sends the user back to the home page. From http://www.4guysfromrolla.com/articles/060805-1.aspx I read that "When the Enter key is pressed within an ASP.NET Web Form that has multiple single-line textboxes, the form will submit and the Button Web control that appears first in the HTML page's markup will have its Click event fired." I was not aware that pressing the Enter key caused a postback.
Click
Thank you very much for taking the time to make your sample. It really helped me to track this down.
Hello Peggy,Thank you for your detailed answer. Please let me check if I understand you correctly. Is the issue resolved?
Yes, it is not really an issue. I put the following before my image button in my master page - <button style="display:none" onclick="return false"></button>. Now when the user presses enter on the dialog window, it does not go to the URL that is specified in the image button.
Your sample helped because then I had a very small app that I could incrementally add controls that are in my app until I found the control that was causing the problem. Thank you very much!