473,660 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Transfer Date from one page to another in aspx

112 New Member
I have two page one is parent and child. Parent page has text field and command button. The Link button open a child page as a popup. Child page as Text box and Button. when i click the button it will transfer child textbox data parent page text box. this is working fine when i use normal page(Not using master page on it).
Parent page aspx:
Expand|Select|Wrap|Line Numbers
  1.  
  2. <asp:TextBox ID="TextBox1" runat="server" AutoPostBack="True"></asp:TextBox>
  3. <a href="#" onclick="OpenNewWindow()">Lookup</a>
  4.  
  5.  
  6. function OpenNewWindow() 
  7. {
  8. window.open('Child.aspx','MyPopUp','width=500,height=700,scrollbars=1,resizable=1');
  9. }
  10.  
Child.aspx:
Expand|Select|Wrap|Line Numbers
  1.  
  2. <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
  3. <input id="Button2" onclick="Transfer()" type="button" value="Select" style="width: 65px" />
  4.  
  5. function Transfer() 
  6. {
  7. window.opener.form1.TextBox1.value = document.getElementById("TextBox1").value; 
  8. window.close(); 
  9. }
  10.  
This code is working fine. Child page transfer the data parent.

But i when i use master page in parent page. I can open child page using pop up. The child page not transfering the data to parent page with same code. i dont know whats went wrong. Can i anybody what i have to change. I am not getting any error and the data is not transfering

Thanks in advance
May 27 '08 #1
21 3942
DrBunchman
979 Recognized Expert Contributor
Hi imtmub,

If you check the source html generated by your code you'll probably find that the ID of TextBox1 has been changed to something like ctl00_Content1_ TextBox1.

To get the actual ID you need to pass the ClientID property of your TextBox control to your popup window and use that to pass the value back. Here's an example:

Parent:
Expand|Select|Wrap|Line Numbers
  1. window.open('Child.aspx?txt=<%=TextBox1.ClientID%>','MyPopUp','width=500,height=700,scrollbars=1,resizable=1');
Child:
Expand|Select|Wrap|Line Numbers
  1. window.opener.form1.TextBox1.value = document.getElementById('" & Request.Querystring("txt") & "').value; 
Let me know how you get on,

Dr B

PS You posted this in the ASP Forum which is for Classic ASP only - I've moved it for you but please remember to post all future ASP.NET questions in the .NET Forum. Thanks.
May 27 '08 #2
imtmub
112 New Member
Dr B
First of all I have to say thanks for ur response.
When i check the Source html genreted by my code My Textbox1 id change to "ctl00_ContentP laceHolder1_Tex tBox1"

Then I have modified my java function according to your suggestion. Still i am facing the same problem. The Textbox is not transfering data to parent page textbox. Can u see anyother info i need to change?

Thanks
May 28 '08 #3
DrBunchman
979 Recognized Expert Contributor
Can you show me the code you're using now on each page please?

Thanks,

Dr B
May 28 '08 #4
imtmub
112 New Member
Can you show me the code you're using now on each page please?

Thanks,

Dr B
Parent Page:
Expand|Select|Wrap|Line Numbers
  1.  
  2. <asp:TextBox ID="TextBox1" runat="server" AutoPostBack="True"></asp:TextBox>
  3. <a href="#" onclick="OpenNewWindow()">Lookup</a>
  4. function OpenNewWindow() 
  5. {
  6.  
  7. window.open('ChildMain.aspx?txt=<%=TextBox1.ClientID%>','MyPopUp','width=500,height=700,scrollbars=1,resizable=1');
  8. }
  9.  
ChildMain:
Expand|Select|Wrap|Line Numbers
  1.  
  2. <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
  3. <input id="Button2" onclick="Transfer()" type="button" value="Select" style="width: 65px" />
  4.  
  5. function Transfer() 
  6. {
  7. window.opener.form1.TextBox1.value = document.getElementById('" & Request.Querystring("txt") & "').value;
  8. window.close(); 
  9. }
  10.  
Thanks
May 29 '08 #5
DrBunchman
979 Recognized Expert Contributor
I can't see anything obvious - can you check the value that is passed in the querystring and compare it the actual ID from your mark-up. Are they the same?
May 29 '08 #6
imtmub
112 New Member
I can't see anything obvious - can you check the value that is passed in the querystring and compare it the actual ID from your mark-up. Are they the same?
I have checked. I m going to leave this wndow.opener.
Do you any other method that i can post back value
May 29 '08 #7
imtmub
112 New Member
I have checked. I m going to leave this wndow.opener.
Do you any other method that i can post back value
I dont know where i m doing wrong. if ou have any demo page that will be great help
May 29 '08 #8
imtmub
112 New Member
I dont know where i m doing wrong. if ou have any demo page that will be great help
Please i wana complete this form with in this week. please help me to transfer data from child page text box to parent page text box.
I have tried java funstion is not working out for me. If you any vb script or demo page that will be great help.
May 30 '08 #9
imtmub
112 New Member
Please i wana complete this form with in this week. please help me to transfer data from child page text box to parent page text box.
I have tried java funstion is not working out for me. If you any vb script or demo page that will be great help.
I m waiting answer. Please help me out
May 30 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

5
7400
by: Tom | last post by:
Hi I am trying to transfer to a different .ASPX page using Server.Transfer. However, I get the following error: "Error executing child request for .aspx." Anyone know why? Thanks for help.
5
7816
by: Julien C. | last post by:
Hi all, I have an "EditeItem.aspx" page which lets me edit properties of an "Item". In the OnClick() event of my Save button, I do save Item changes to the database and then I redirect the user to the Item page "ViewItem.aspx" with a simple : Server.Transfer("ViewItem.aspx"); I'd like to pass another HTTP parameter so that in the "ViewItem.aspx" page,
0
1091
by: Amar | last post by:
After using Server.Transfer to transfer data from one page to another, I would like to know if there is a way to keep the receiving web page variables intact after a postback. Here is the code from the "sending" page: <code> Public ReadOnly Property SelectedDate() As Date Get Return Calendar1.SelectedDate End Get
2
3209
by: Mr Wizard | last post by:
I am going through the front controller http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpatterns/html/ImpFrontControllerInASP.asp and all works well except when the server.transfer occurs. I get invalid IsPostBack results which I believe can fixed using the patch in KB:821156. How do I get this patch? Another question in the same pattern is when using LoadConrol to load a .ascx file I get "maps to another application,...
1
1842
by: Terry Mulvany | last post by:
Grettings, Normally I can use Request.RawUrl to get the 'current' page (amongst many other things). But in the case of using a Server.Transfer but the path from the root of the site . So if foo.aspx server.transfer()ed to http://www.domain.com/somefolder/bar.aspx I need '/somefolder/bar.aspx'. Thanks in advance.
2
3750
by: David Berman | last post by:
It seems that my site is losing session information when using Server.Transfer. I have a page called PictureGallery.aspx. It takes an argument which is an index id, so it would look like PictureGallery.aspx?id=30 to display gallery 30. In this way I have a database driven picture gallery. To improve indexing, I put code in Global.asax to allow me to get to the same page with a url like this: Pictures_30.aspx. There is no...
7
267
by: dee | last post by:
Inside Search.aspx I make the following call: Server.Transfers("Table.aspx"); I'm transfered to Table.aspx and browser still shows Search.aspx in address bar. However, I do postback within Table.aspx. The first time that there is postback the address bar shows Table.aspx! Am I correct to assume that this is not the right place to use Transer function, as it's showing inconsistancy with the address bar? Thanks.
8
3889
by: bryan | last post by:
I've got a custom HttpHandler to process all requests for a given extension. It gets invoked OK, but if I try to do a Server.Transfer I get an HttpException. A Response.Redirect works, but I really need to avoid the extra round-trip to the client. I've tried Passing the page name, the full URL, and the instance of the handler class to the Transfer method, but everything gets me the same error 500. Any help would be appreciated.
4
4000
by: evantay | last post by:
I'm using ASP.NET 2.0 with VS.NET 2005. I'm trying to access properties from my master pages within a page that inherits from that master page (a child page). However the values are always null. In my masterpage I have this: private bool m_AlreadyTested; public bool AlreadyTested { get { return m_AlreadyTested; }
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8341
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4343
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2760
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1740
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.