|
-
Mar 31st, 2004, 02:04 PM
#1
Thread Starter
Addicted Member
Why! Why! I keep getting returned back to my login page.
For some reason i keep getting kicked back to my login page and i can't for the life of me work out WHY!
VB Code:
<%@ trace="true" %>
<script runat="server">
Sub Page_Load
Dim checkstr as string
checkstr = Request.QueryString("action")
If User.Identity.ISAuthenticated = "false" then
If not Request.QueryString("action") = "login" then
Response.Redirect("default.aspx?action=login")
end if
end if
End Sub
Sub Button_click
Trace.Write( " txtUsername.text = " & txtUsername.text )
Trace.Write( " txtPassword.text = " & txtPassword.text )
If txtUsername.text = "So" and txtPassword.text = "So" then
FormsAuthentication.RedirectFromLoginPage( txtusername.text, chkRemember.Checked )
else
Response.Redirect("default.aspx?action=summ")
End If
End sub
</script>
<% Select Case Request.QueryString("action")
Case "login"%>
<html>
<head><title>default.aspx?action=login</title></head>
<body>
<form Runat="Server">
<h2> Please Login: </h2>
<asp:Label
ID="lblMessage"
ForeColor="Red"
Runat="Server" />
<p>
<b>Username:</b>
<br>
<asp:textbox
ID="txtUsername"
Runat="Server" />
<p>
<b>Password:</b>
<br>
<asp:textbox
ID="txtPassword"
Runat="Server" />
<p>
<asp:checkbox
ID="chkRemember"
Runat="Server" />
Remember me with a cookie?
<p>
<asp:button
Text="Login!"
Runat="Server" />
</form>
<% Case "filelist" %>
<% Case "fileupload" %>
<% Case Else
Response.Redirect("Action is Null") %>
<% End Select %>
DEFAULT.ASPX
VB Code:
<configuration>
<system.web>
<authentication mode="Forms">
<forms
name=".ASPXAUTH"
loginUrl="Default.aspx?action=login"
protection="All"
timeout="80"
path="/"/>
</authentication>
<authorization>
<deny users="?" />
</authorization>
<compilation debug="true"/>
</system.web>
</configuration>
WEB.CONFIG
Also i want all log-in's to go to
efile.aspx?action=summ
can some help me on this to?
-
Mar 31st, 2004, 07:01 PM
#2
I wonder how many charact
Stupid question, have to ask it, sorry:
Are you typing the address of your login page in the browser, or the page you want to go to? It should be the page you want to go to, and if that wasn't passed, it should default to whatever page you set.
Also, You are trying to redirect from the login page, even though the user was never authenticated, which is why it probably keeps kicking you back to the login page.
Code:
If txtUsername.text = "So" and txtPassword.text = "So" then
'YOU NEED TO SET AN AUTHORIZATION TICKET HERE
FormsAuthentication.RedirectFromLoginPage( txtusername.text, chkRemember.Checked )
else
Response.Redirect("default.aspx?action=summ")
End If
Last edited by nemaroller; Mar 31st, 2004 at 07:07 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|