Hi Ken,
I have tried again by removing other remarks on the <authorization> and it
work! Thanks for that. Btw, I have another question, I want this
authorization(login page) be shown if other user will access other webforms
under this web apps that is not yet authenticated. How can I do this?
Me
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:#0**************@TK2MSFTNGP12.phx.gbl...
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
----------------
"A P" <ap@textguru.ph> wrote in message
news:OR**************@TK2MSFTNGP15.phx.gbl...
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