Results 1 to 3 of 3

Thread: Page values reset after opening a new window

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2004
    Posts
    149

    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.

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538

    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

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2004
    Posts
    149

    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width