Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending WebForm data from one page to another!

Status
Not open for further replies.

antonio622

Programmer
Jun 10, 2007
20
US
I'm back to ASP.net programming. Ive been writing games in DirectX for about 6 years and got away from Database programming. Before that I used the old ASP and now I am new to ASP 2.0 which I believe is a different animal.

This post is about sending WebForm data from one .aspx page to another.

I'm just wondering how most ASP programmers are accomplishing this:

I have a Login page where existing users can log in or create a new user account.

(These variables are WebForm Controls)

How can I transfer this data to another .aspx page which recieves the WebFormsControl.text and searches the Database.

How are most of you accomplishing this? I read in one article that ASP.net doesnt recommend or even support this.
I find it very hard to believe because I know that most websites that contain a database structured interface exist of many pages that direct the user to multiple pages.
 
Thank you greatly for your response. I read through a book recently on ASP.net 2.0 and with my experience of Microsoft programming I skipped through the LOGIN SERVICE WIZARDS.

I guess it would be great to experiment with it because it will contain some helpful code.

I basically want to have the experience and fun coding this from scratch. Im sure its pretty basic and the code from the wizards can be a good reference.

I pretty much have a great background in Database programming.

The only thing that confuses me about ASP.net is moving Variables & WebControl data from page to page.

I'm probably gonna need this knowledge somewhere else in my project anyway rather then just the login.

Anyone have any type of example code to move data from one page to the next?
 
You have several options:

1) Use Querystring variables to pass the data (GET method)
2) Set the PostBackUrl to pass the data (POST method)
3) Server.Transfer
4) Store the values in the Session/Cache/Context objects



-------------------------------------------------------

Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Delivering professional ASP.NET solutions
[URL unfurl="true"]http://weblogs.asp.net/marksmith[/url]
 
1) Use Querystring variables to pass the data (GET method)
2) Set the PostBackUrl to pass the data (POST method)
3) Server.Transfer
4) Store the values in the Session/Cache/Context objects

Which is the better or faster of the 4 methods above?

I like the Server.Transfer approach! I find it easier.
 
There is no best or fastest methods, rather just an appropiate one for the situation. Usually, #1 or #2 are the most commonly used and recommended methods but it really depends on the situation. #3 brings it's own problems, and #4 is often over used and abused.


-------------------------------------------------------

Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Delivering professional ASP.NET solutions
[URL unfurl="true"]http://weblogs.asp.net/marksmith[/url]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top