Solved

open a child window on button click without doing any postbacks to parent form and send a value to parent form on closing the child window.  asp.net vb.net

Posted on 2007-12-04
6
4,050 Views
Last Modified: 2008-02-01
how to open a child window without doing any postbacks with parent window and send the value from child window to parent window on closing child window.

examples of this type of windows are found in some sites like

www.microsoft.com
www.asp.net -when posting a quick reply.
0
Comment
Question by:aditya_raj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
6 Comments
 
LVL 12

Accepted Solution

by:
needo_jee earned 250 total points
ID: 20409139
to open window use
window.open("mytest.aspx,"","",);

to return value from child..

if you have a textbox on parent and from child you can assign value or you can call some parent form js function from child ..

lets supposed you have a close button on child when you click that . it work like this

window.operner.form1.textboxTest.value=document.for1.getElementByID('myChildTextBox').value;
0
 
LVL 5

Assisted Solution

by:pavaneeshkumar
pavaneeshkumar earned 250 total points
ID: 20409142
use window.open("url ") in click event handler. this will cause to open new window without postback
window.open("http://www.google.com")

Open in new window

0
 
LVL 12

Expert Comment

by:needo_jee
ID: 20409158
sorry .. here is more explanation
you may write JS function in ASPX and call where you need to open window..
like <script language="Javascript">
function OpenChildwindow()
{
window.open("mytest.aspx","Child Window"," ");
}

// on the form you have a button .. onclick event of that button you may call above function
OR
directly in button
onclick="Javascript:window.open('test.aspx','test');
thanks
0
 
LVL 12

Expert Comment

by:needo_jee
ID: 20409792
Here is working example for the requirements:
//PopUp.aspx ***************************************
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="popUp.aspx.cs" Inherits="popUp" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <script  language ="javascript">
    function setValue()
    {
    opener.form1.Button2.value="From pop form";
    self.close(); 
    }
    </script> 
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <input id="Button1" onclick ="setValue();" type="button" value="button" /></div>
    </form>
</body>
</html>
 
//Parent.aspx *****************************************
 
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Dec04.aspx.cs" Inherits="Dec04" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <script language ="javascript">
      function OpenPopUp()
    {
    window.open("popUp.aspx");
    }
    
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
       <input id="Button2" onclick="OpenPopUp();" type="button" value="button" /></div>
    </form>
</body>
</html>

Open in new window

0
 
LVL 1

Expert Comment

by:Computer101
ID: 20632933
Forced accept.

Computer101
EE Admin
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question