close window in asp.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thiruanand24
    New Member
    • Feb 2008
    • 13

    close window in asp.net

    Currently, i have a button called btnInclude, when clicked on form1 for example,
    it will open a new window called form2. After i press a button in form2,
    i will take the necessary values and form2 window should close.
    Another thing is i do not know how to get the values from form2 and get form1 to auto-refresh and show the
    values retrieved from form2.
  • deric
    New Member
    • Dec 2007
    • 92

    #2
    Hi...

    As far as I know, there are 3 ways in which you can achieve what you require:

    1. Use of session variables, or
    2. Use of opener object in javascript, or
    3. If you can close form1 after calling form2, you can call form1 again from form2 and this time include on the querystring the values that you want to pass to form1.

    For the number 2 above, here's a sample:
    Code:
    //Place this on your js function that will handle the onclick event of your form2's close button.
    if (window.opener && !window.opener.closed)
        window.opener.document.stockForm.stockBox.value = symbol;
    window.close();
    Can you post what you have so far?

    Comment

    Working...