passing user name info to protected page

J

jason

Hello.

Newbie question I'm sure.

I've got this page I am securing with a password using a simple
LOGIN.ASPX page:

<%@ Page Language="VB" %>
<script language="VB" runat="server">

Sub btnLogin_OnClick(Src As Object, E As EventArgs)
If txtUsername.Text = "passwordhere"
FormsAuthentication.RedirectFromLoginPage(txtUsername.Text, True)
Else
lblInvalid.Text = "Sorry... try again..."
End If
End Sub

</script>

.... more html here

and the WEB.CONFIG PAGE:

<configuration>
<system.web>
<customErrors mode="Off"/>
<authentication mode="Forms">
<forms name="FNAME" loginUrl="login.aspx" />
</authentication>

</system.web>
<location path="protectedpage.aspx">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>

</configuration>
==

Nothing too fancy ... I'd like a few more users and then pass the
protected page a session variable (maybe) with the valid username.

How would/could I do this?

Many thanks for any info or help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top