I have a simple login page that directs the user to an aspx page if they correctly enter their username and password. This page cannot be accessed unless they have logged in, To achieve this I have used a web.config file that denies unauthorised visitors. Here is my web.config file.
<configuration>
<location path="Data">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
<authentication mode="Forms" />
</system.web>
</location>
</configuration>
This works well, however i'm wanting to be able to identify the user who logs in. Can anyone help with this?? Here is some code from my login page
Sub CheckCredentials_Click(s As Object, e As EventArgs)
If (CheckCredentials(txtUsername.Text, txtPassword.Text) = True) Then
Formsauthentication.redirectfromloginpage(txtUsername.Text,false)
lblCheck.Text = "You entered the right credentials!"
Response.Redirect("AddData.aspx")
Else
lblCheck.Text = "You entered the wrong credentials!"
End If
End Sub
In the AddData.aspx page I'm wanting to be able to say Welcome (txtUsername.Text).