How to return a value from a pop up window in asp.net using vb

dyarosh
dyarosh used Ask the Experts™
on
I have a website that has a form that allows a user to select a profile from a list.  One of the options is for the user to copy the profile.  I want to open a popup window to prompt for the new profile name and then return to the original window to do the copy.  Here is what I have so far:  (I am using vb.net)

page1.aspx

<form>
<asp:Button ID="CopyProfileBtn" runat="server" Text="Copy Profile" />
</form>

page1.aspx.vb

In the PageLoad function:

            'Set Popup Window on CopyProfile Button
            Me.CopyProfileBtn.Attributes.Add("onclick", _
                    "window.open('page2.aspx', '', 'height=300,width=400');return false")

page2.aspx

<form>
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</form>


How do I get the value in TextBox1 returned to page1.aspx when page2.aspx is closed?
How do I close page2.aspx?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
HI,
I would say that your approach is completely wrong.
There is no need of opening a new aspx page just containing a single textbox.
It will cause and unnecessary request to server.

You can just create a div containing textbox and show the div on button click and get the required value from textbox.

Author

Commented:
Makes sense. I am implementing your approach.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial