Hi,
Here is some code for the login page. I placed 2 textboxes for
username and passsword and 2 required field validators on the form. The
code is just an example. In a real situation you should store the passwords
encypted. Hope this helps.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnClear.Click
txtUser.Text = ""
txtPassword.Text = ""
End Sub
Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnLogin.Click
If Page.IsValid Then
If txtUser.Text = "Mike" And txtPassword.Text = "password" Then
Response.Redirect("Default.aspx")
Else
Response.Write("Invalid User !")
End If
End If
End Sub
Changes that should be made to Web.config
<authentication mode="Forms" >
<forms name="Mypubscookie" loginUrl ="Login.aspx" protection="All"
timeout="30">
</forms>
</authentication>
Ken
----------------
Hi!
I have existing web apps that was developed under ASP. I use form
authentication by querying to a database if the user is allowed to use the
application. I have read that ASP.NET is much easier to manage this kind of
security. Can you help me with this?
Me