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
3,951 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
  • 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Help with error message for ReportViewer in VS2015 4 26
JavaScript error 1 34
Data Saving(2) 2 26
Change data in datatable 8 18
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
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.…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now