Hi Alexey,
Thanks a lot for answer and your effort!
I adapted the code until it run fine on my machine. (The code is below.)
Having your keywords in your code it`s much easier to come further.
I guess when exchange "FormsAuthentication.Authenticate" with
"MyOwnLogInTest(user,pass)" I can have my own authentication.
Moreover I assume that I can't use the asp.net login controls.
Regards,
Rudi
-------------------------------------
<%@ Page Language="VB" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Web.Security " %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Test</title>
</head>
<body>
<form id="Form1" runat="server">
Name:<br />
<input id="UserName" type="text" runat="server" /><br />
Password:<br />
<input id="UserPass" type="password" runat="server" /><br />
<input type="submit" onserverclick="SubmitBtn_Click"
runat="server" id="Submit1"
name="Submit1" value="Try login!" />
<asp:Label ID="lblMsg" runat="server" />
</form>
<script language="vb" runat="server">
Sub SubmitBtn_Click(ByVal Source As Object, ByVal E As EventArgs)
If FormsAuthentication.Authenticate(UserName.Value,
UserPass.Value) Then
FormsAuthentication.RedirectFromLoginPage(UserName .Value, False)
Else
lblMsg.Text = "Credentials not valid!"
End If
End Sub
</script>
</body>
</html>
Alexey Smirnov wrote:
On Apr 4, 11:36 am, Rudi Hausmann <rudi...@nospam.comwrote:
>Yes, I am. When I press the Log In button I get the error above. I just
want the credentials to be read from web.config and not from a database
which I didn't set up and which I also don't want to set up.
Okay. Let's test it. Take my login.aspx and try to login with any of
your name
<%@ Page Language="VB" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Web.Security " %>
<HTML>
<HEAD>
<title>Test</title>
</HEAD>
<body>
<form id="Form1" runat="server">
Name:<br />
<input id="UserName" type="text" runat="server"><br />
Password:<br />
<input id="Password1" type="password" runat="server"><br />
<input type="submit" OnServerClick="SubmitBtn_Click" runat="server"
ID="Submit1" NAME="Submit1" value="Try login!">
<asp:Label id="lblMsg" runat="server" />
</form>
<script language="vb" runat="server">
Sub SubmitBtn_Click(ByVal Source as Object, ByVal E as EventArgs)
If FormsAuthentication.Authenticate(Username.Value, UserPass.Value)
Then
FormsAuthentication.RedirectFromLoginPage (UserName.Value, false)
else
lblMsg.text="Credentials not valid!"
End If
End Sub
</script>
</body>
</HTML>