Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > Other ASP.NET > ASP.NET 1.x and 2.0 Application Design
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design 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 August 11th, 2005, 09:53 PM
Registered User
 
Join Date: Dec 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to post the date to another page ASP.NET?

Hi All,

Im new to ASP.NET.
How to post the date to another page ASP.NET?
For Eg. I have 2 page

1) Login.aspx
2) Main.aspx

I want to post the username and password from Login.aspx to Main.aspx.
But im not able to read the data from my Main.aspx.

How to do this?
Please help me in this regard.
 
Old August 12th, 2005, 04:06 AM
Authorized User
 
Join Date: Jul 2005
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Probably one of the easiest ways (but unfortunately less secure is to use a querystring.) If you are checking usernames and passwords I am guessing that these are in a database table somewhere. If so, make sure you have an id (or some sort of primary key) in this table. Find a way to pass the id value of the user within the url of the next page. It should look something like this:

Sub OnClick
Dim strSelect As String

strSelect="Select * From loginTable Where @username= username,@password=password"
myCommand2 = New OleDbCommand( strSelect, objConn )
            myCommand2.Parameters.Add( "@ID", intID )

Response.Redirect(Main.aspx?id={0})
End Sub

Then on the Main page dimension a variable in order to capture the id that was passed in the url. It can look something like this:

Dim intID as Integer
intID = Int32.Parse( Request.QueryString( "id" ) )

Then write a command that finds the record in the table that contains the info you want to display using the querystring value you got in your criteria ("WHERE") portion of your command. The command can look something like this:

Dim strSelect2 As String

strSelect2 = "Select * From loginTable Where ID=@ID"
            myCommand2 = New OleDbCommand( strSelect, objConn )
            myCommand2.Parameters.Add( "@ID", intID )

Code may be little different but the main idea is to capture the users information by passing his/her id to the next page. Once you do that then write a command that will get the users info on your main page (i.e. passing the info)







Similar Threads
Thread Thread Starter Forum Replies Last Post
post xml data from ASP.NET app to ASP app polekat Classic ASP Professional 2 January 31st, 2007 08:44 AM
XML Post From VB to asp page LanceAtCti VB How-To 2 July 13th, 2006 08:58 AM
Reading an XML post in an ASP.NET web site spudgun2005 ASP.NET 1.0 and 1.1 Basics 0 November 3rd, 2005 05:40 PM
Consuming web services in asp.net using http post dpk100 .NET Web Services 1 May 4th, 2005 02:03 AM





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