Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 26th, 2005, 10:17 AM
Authorized User
 
Join Date: May 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to saravananedu
Default Transfer Values from one page to another page

Dear all,

Im beginner to asp.net I have created a project with two web pages. the first page (page1.aspx) contains one dropdown, one textfield and one button. (all the three are web controls). i just want to retrieve and display the contents from page1.aspx in second page (page2.aspx) while clicking the button from page1.aspx.

im using c# as the code behind file.

im facing lot of troubles such as,

(i) if i keep the button as web control, the page is not redirecting , even though i have written the response.redirect code on the buttonclick event at the .cs file.

(ii) if i keep the button as html control and in form tag if i mention action="page2.aspx" , im able to navigate to second page but i cant retrieve the textfield/dropdown values.

kindly help me to sort out this problem in either way.

thanks in advance.


Yours,
Saran
__________________
Best Regards,
Saran.
 
Old April 26th, 2005, 10:41 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Can you post the relevant parts of the code for the button click? (The handler method and the event wiring.)
Can you verify that the button click is firing? (You could try a response.write) Is it possible that you haven't got the handler wired to the button event properly?

The ASP style of form posting using a different action value for the target page is not how ASP.NET is intended to work. If you need to carry information from one page to another you need to use a suitable method such as query string values or session state.

-Peter
 
Old April 28th, 2005, 04:11 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

You can also try Server.Transfer("page2.aspx", true) to preserve the form elemnts in the next page. From there you can access the properties of the calling page.

Regards
Ganesh
 
Old April 28th, 2005, 08:58 AM
Authorized User
 
Join Date: May 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to saravananedu
Default

Thanks Ganesh,

   i got it now. actually i have used server.transfer only but then i dont know , what happened. so i removed and started freshly and got that. thanks for ur reply.

Quote:
quote:Originally posted by r_ganesh76
 You can also try Server.Transfer("page2.aspx", true) to preserve the form elemnts in the next page. From there you can access the properties of the calling page.

Regards
Ganesh
Yours,
Saran
 
Old April 28th, 2005, 11:29 PM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

cheers Saran

Regards
Ganesh
 
Old August 12th, 2005, 11:57 AM
Registered User
 
Join Date: Aug 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

HI! I am having a similar problem. but in my case i have to transfer data from second page to the first page. I have two pages. the first calls the second. User enters some details in the second page and these details are to be passed to the first page.
Please help me on this one.

 
Old August 17th, 2005, 12:03 AM
Registered User
 
Join Date: Jun 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default



hi you can use the Context.Handler

for transfering the values from one page to another page.
just create an object for that form and get aceess the Control values of the other form.
ex:
Form1 ff= (Form1) Context.Handler ;

i think it might be helpfull for you
rgds
ramana123






Similar Threads
Thread Thread Starter Forum Replies Last Post
transfer a DataTable from one Page to another ratheesh_param ASP.NET 2.0 Professional 1 November 30th, 2006 05:58 AM
Transfer Page Setup Properties JpJoe Excel VBA 0 January 12th, 2006 11:04 AM
Transfer to another page in same Application rastvan ASP.NET 1.0 and 1.1 Professional 1 February 13th, 2005 06:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.