I am using VS 2008 with C# for my web application. For e.g. I have a textbox say with id "TextBox1" and through javascript , using windoq.open I have opened a pop up, now on that pop up window I want the value written in the "TxtBox1". How I can do that
whether in the javascript or in C#. Please let me know how this can be done.
Thanks & Regards
Girish Nehte
Thanks & Regards
Girish Nehte
If This post helps you to solve your problem please mark this as an answer.
u can do it with using querystring or session or by inserting values in cookies and then retriving them.
For example u can use query string as window.open("urUrl?txt1=" + document.getElementById("TextBox1").value) if textLength not greater than 255 chars. Else Use Session.
Then retrive it from queryString.
As
dim strFromParent as String
If Not Request.QueryString("txt1") Is Nothing then
<asp:textbox id="textbox4" runat="server" /> get date from calender i want when i click on (get date from calender) it show the calender in new pop up window then user select date then the date which selected by user on child window (popUp window) i want it to be set into corresponding textbox can i do such that??
girishnehte
Member
76 Points
433 Posts
pass data from parent window to Child window
Nov 21, 2008 09:00 AM|LINK
Hello Friends,
I am using VS 2008 with C# for my web application. For e.g. I have a textbox say with id "TextBox1" and through javascript , using windoq.open I have opened a pop up, now on that pop up window I want the value written in the "TxtBox1". How I can do that whether in the javascript or in C#. Please let me know how this can be done.
Thanks & Regards
Girish Nehte
Girish Nehte
If This post helps you to solve your problem please mark this as an answer.
aloksinha83@...
Participant
843 Points
183 Posts
Re: pass data from parent window to Child window
Nov 21, 2008 10:41 AM|LINK
Hi,
u can do it with using querystring or session or by inserting values in cookies and then retriving them.
For example u can use query string as window.open("urUrl?txt1=" + document.getElementById("TextBox1").value) if textLength not greater than 255 chars. Else Use Session.
Then retrive it from queryString.
As
dim strFromParent as String
If Not Request.QueryString("txt1") Is Nothing then
strFromParent =Request.QueryString("txt1").ToString
End If
shobhit rai
Participant
1725 Points
404 Posts
Re: pass data from parent window to Child window
Nov 21, 2008 10:45 AM|LINK
hello
Dim s1 As String = ""s1 &=
"<script language=""javascript"">"s1 &=
"window.opener.formname.txtFullname.value='"s1 &= ListBox1.SelectedItem.Text &
"';"s1 &=
"window.opener.frmnewuser.hdnuserid.value='" & ListBox1.SelectedValue.ToString & "';"s1 &=
"window.close();"s1 &=
"</script>"ClientScript.RegisterStartupScript(
Me.GetType, "aa", s1)http://shobhitrai.blogspot.com/
ricky.rumand...
Member
100 Points
15 Posts
Re: pass data from parent window to Child window
Nov 21, 2008 11:46 AM|LINK
//Default.aspx
<%
@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!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></title></
head><
script language="javascript" type="text/javascript"> function OpenNewWindow() {window.open(
"Page2.aspx?txt1=TxtBox1");}
</script><
body onload="OpenNewWindow"> <%-- Here you will javascript called OpenNewWindow--%> <form id="form1" runat="server"> <div>
</div> </form></
body></
html>//On Page2.aspx behind code, write this...
protected void Page_Load(object sender, EventArgs e){
if (Request.QueryString["txt1"] != null){
TextBox1.Text = Request.QueryString["txt1"].ToString();}
}
hope you got the answer...faisalnk
Member
452 Points
110 Posts
Re: pass data from parent window to Child window
Nov 21, 2008 12:09 PM|LINK
Hi,
Please find below article which is included in the ASP.NET Wiki
This will show how to get popup window's textbox value in parent window in step by step process.
http://wiki.asp.net/page.aspx/282/passing-value-from-popup-window-to-parent-form39s-textbox/
Don't forget to click "Mark as Answer" on the post that helped you.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Thanks & Regards
Faisal. N
wahb.alaamri
Member
2 Points
1 Post
Re: pass data from parent window to Child window
Jan 21, 2013 08:44 AM|LINK
<asp:textbox id="textbox1" runat="server" />
get date from calender
<asp:textbox id="textbox2" runat="server" />
get date from calender
<asp:textbox id="textbox3" runat="server" />
get date from calender
<asp:textbox id="textbox4" runat="server" />
get date from calender
i want when i click on (get date from calender) it show the calender in new pop up window then user select date
then the date which selected by user on child window (popUp window) i want it to be set into corresponding textbox
can i do such that??