Page values reset after opening a new window
I have an online form. On page_load, I load attributes of 3 buttons on my form to open another window which will allow the user to make choices which then get returned to the main window. The code is as follows:
btnAddBuilding.attributes.add("OnClick", "window.open('BuildingSelect.aspx','BuildingSelect','height=480,width,width=550')
and repeated for the other 2 buttons.
When running the application, the first time you press the button and return a value, everything is fine, values in textboxes get populated and all is good so far.
When you click on another button though, or even the same one to change the values, the main page refreshes when the new webpage loads and all the values get wiped out.
How can I prevent my values from disappearing?
Any help would be appreciated.
Thanks.
Re: Page values reset after opening a new window
Do you have any code relating to the textboxes on the Page_Load() event? If so, you'll need to put these inside an if statement so they are only executed the 1st time the page is requested:
Code:
If Page.IsPostBack = False Then
'Code to modifyt the textbox information here
End If
Re: Page values reset after opening a new window
No, there is no code relating to the textboxes on the page_load event.
The one thing I do notice is, when the 2nd window opens the main page's status bar goes up with the 2nd's like they are attached together. Like it is being refreshed.
Any ideas?