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)
|