I am having trouble isolating and fixing the cause of a hang, freeze, or locking form that fails to load correctly after the third go.
There are several conditions that must exists for this to take place.
- Using Ajax UpdatePanel with a formview inside the UpdatePanel, create a web form called formViewForm.aspx. (I like how the user does not see the page reload and believes the form is live!)
- The data source is created using the SQLAdapter connecting to a three column table in SQL Server 2000 (using the SQL commands built into the SQLAdapter, nothing special).
- Place a ASP.net server control button on the item panel, label it CloseButton, text=Close, and OnClientClick="window.close()"
- create another form and place another ASP.net server control button on the page, anywhere. Set the name = OpenButton, the Text = "Open", and the OnClientClick="window.open(formViewForm.aspx,"EditForm",formFeatures); f(ormfeatures control what features are active, like menubar, toolbar, statusbar, height and width, etc.)
- Set the new form as the default form and run the debug.
Press the Open button, and the formviewform opens fine. Press the close button and the form closes fine. Repeat this again and all is still fine. press the open button one more time and the formview never fully opens, just hangs with the url in the title bar and blank everywhere.
If I close both forms and try to run it again in a big hurry (like real world people do) then I get a severe error and have to restart VisualStudio 2005 to remedy the problem.
If you repeat the above procedure of open and close and instead of using the close button, close the form using the window close (X) button in the upper right corner, then there is no problem.
So the problem lies with the window.close() command.
Any one seen this before or have a fix or way to figure out what else must be done to ensure a clean close so nothing inteferes with opening?