In my .aspx page there is a button and a textbox, if I click on this button a new form open where i have bound some data. Now what i make it like if i click on any item on this newly open form then the value or text should fill in the first
form's textbox.
should i use query string, if yes then how can u explain a bit
thanx
It is our choices that show what we truly are, far more than our abilities...
If the second page is opened in popup window then you can opener.document.getElementbyTagName
if not use hidden text box to store first page text box values in hidden text box, in the second page on click you can fill those values from the hidden fields to textboxes using javascript.
Thanks
Hari
---------------------------------------------
Dont forget to click "Mark as Answer" on the post that helped you.
Write the code on Button_click event of page1.aspx
Response.Redirect("page2.aspx?name=" + textbox1.text ,False);
on page2.aspx
Page_Load()
Textbox1.Text= Request.QueryString["name"].ToString();
Let me tell you more abt this so that i can get the right solution.
There is a button and a text box on my .aspx page, when I click on button, a new .aspx form open (but the parent .aspx page remain, it should be there with the new .aspx form) and there are a radiobuttonlist.
So what i like to do is when i click a radiobutton item it the text value of this selected radiobutton fill in tha parent form's textbox. and the form should close automatically.
What method i use so that parent form should available with the newly open form.
pls suggest me
thanx a lot
It is our choices that show what we truly are, far more than our abilities...
I dont use javascript a much and am new to this so can you pls write the appropriate code for this, how to open new window which should be a .aspx page..
thanx a lot [:)]
It is our choices that show what we truly are, far more than our abilities...
demoninside9
Participant
1260 Points
1721 Posts
How to move value from one form to another
May 21, 2009 10:19 AM|LINK
Hi All,
In my .aspx page there is a button and a textbox, if I click on this button a new form open where i have bound some data. Now what i make it like if i click on any item on this newly open form then the value or text should fill in the first form's textbox.
should i use query string, if yes then how can u explain a bit
thanx
hariram.p@li...
Contributor
3366 Points
707 Posts
Re: How to move value from one form to another
May 21, 2009 11:08 AM|LINK
If the second page is opened in popup window then you can opener.document.getElementbyTagName
if not use hidden text box to store first page text box values in hidden text box, in the second page on click you can fill those values from the hidden fields to textboxes using javascript.
Hari
---------------------------------------------
Dont forget to click "Mark as Answer" on the post that helped you.
My Site
rtpHarry
All-Star
56620 Points
8958 Posts
Re: How to move value from one form to another
May 21, 2009 11:11 AM|LINK
For simple values you can pass the data in the QueryString.
To use it you use response.redirect in your button click like this:
Response.Redirect(String.Format("~/YourSecondForm.aspx?Value={0}", Textbox1.Text));Then to collect it you can grab the query string anywhere you want. You could use some code like the following in page_load:
rtpHarry
All-Star
56620 Points
8958 Posts
Re: How to move value from one form to another
May 21, 2009 11:15 AM|LINK
There are a wide range of options for passing databetween pages:
You should be able to find a lot more information on MSDN.
venkatu2005
All-Star
32487 Points
6742 Posts
Re: How to move value from one form to another
May 21, 2009 11:16 AM|LINK
there are no.of way to pass a value from page to another page
http://dotnetslackers.com/Community/blogs/haissam/archive/2007/11/26/ways-to-pass-data-between-webforms.aspx
Write the code on Button_click event of page1.aspx Response.Redirect("page2.aspx?name=" + textbox1.text ,False); on page2.aspx Page_Load() Textbox1.Text= Request.QueryString["name"].ToString();Thanks.
mudassarkhan
All-Star
78956 Points
13402 Posts
MVP
Re: How to move value from one form to another
May 21, 2009 11:34 AM|LINK
Here all the methods are described
http://www.worldofasp.net/tut/redirect/Passing_Values_from_One_Page_to_Another_in_ASPNET_152.aspx
Contact me
demoninside9
Participant
1260 Points
1721 Posts
Re: How to move value from one form to another
May 22, 2009 03:17 AM|LINK
Thanx for yur replying..[:)]
Let me tell you more abt this so that i can get the right solution.
There is a button and a text box on my .aspx page, when I click on button, a new .aspx form open (but the parent .aspx page remain, it should be there with the new .aspx form) and there are a radiobuttonlist.
So what i like to do is when i click a radiobutton item it the text value of this selected radiobutton fill in tha parent form's textbox. and the form should close automatically.
What method i use so that parent form should available with the newly open form.
pls suggest me
thanx a lot
sgeorge80
Member
240 Points
64 Posts
Re: How to move value from one form to another
May 22, 2009 04:09 AM|LINK
Hi,
You can open a new pop up window using javascript window.open('url');
From inside the newly open window, you can set a textbox in the parent window using the following command
parent.opener.parent.document.getElementById('textboxname').value = Val;
If you want to close the pop up window also, you can use window.close();
demoninside9
Participant
1260 Points
1721 Posts
Re: How to move value from one form to another
May 22, 2009 04:16 AM|LINK
I dont use javascript a much and am new to this so can you pls write the appropriate code for this, how to open new window which should be a .aspx page..
thanx a lot [:)]
mudassarkhan
All-Star
78956 Points
13402 Posts
MVP
Re: How to move value from one form to another
May 22, 2009 05:53 AM|LINK
Refer my article
http://www.aspsnippets.com/post/2009/02/01/PopUps.aspx
Contact me