[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
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
Medium Priority
?
4,107 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:
Munawar Hussain earned 1000 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 1000 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:Munawar Hussain
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:Munawar Hussain
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

649 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