Click here to Skip to main content
15,885,155 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi
I have two Page One Login.aspx and Second is Inbox.aspx

When I login with Correct Details, Login Page Redirect me to a Inbox.aspx Page

Now I want to Check on Inbox.aspx Page Load Event for Valid User Login or Not.

My Basic Concept is to Block Access the Inbox Page from Guest User.

How to Check it? I use Access 2003 Database with VS 2008.

LOGIN BUTTON CODE :

VB
Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data source=" & Server.MapPath("TEST.mdb"))
        Dim cmd As OleDbCommand
        Dim MyReader As OleDbDataReader
        con.Open()
        cmd = New OleDbCommand("Select Pass from User where Uname ='" & uname.Text & "';", con)
        MyReader = cmd.ExecuteReader()
        If Not MyReader.Read() Then
            statuslbl.Text = "Wrong Details, Enter Username and Password Again."
        Else
            If MyReader(0).ToString() = passwrd.Text Then
                Response.Redirect("Inbox.aspx")
            Else
                statuslbl.Text = "Wrong Password."
            End If
        End If
Posted

1 solution

SOLVED MYS SELF

with
VB
If Session("Loggedser") Is Nothing Then

Response.Redirect("Login.aspx", False)
End If
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900