Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force login page 1

Status
Not open for further replies.

kurie

Programmer
Jun 4, 2008
170
0
0
ZA
Hie all
I have developed a website and i want to access the pages from frmMain where users login, I have set the page frmMain as the start page but i can still type the page name like:
and access it, Does anyone know how to stop this.
 
use the authorization/authentication nodes in the web.config to secure the directory. for examples of how to do this google "asp.net configure forms authentication"

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
You can also set a variable to be checked when every page is loaded to see if a user is logged in. This variable would be set when the user logs in. So the log in page would be the only page not checking for this variable.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- The Complete IT Community
 
Hi,
You can also add a check on this page:


that will test for the 'sending' page and if it is not your login page, take some action ( like sending the user to the proper starting page)



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
I have got a problem with form authentication.
My problem is whenever i want to go to another page(after loggin in) im redirected to the first page/the login page. does anyone know what wrong
Here is my code for the sessions,

<script language="C#" runat="server">
void Login_Click(Object sender, EventArgs E)
{

if ((UserEmail.Text == "username@domain.com") &;
(UserPass.Text == "password"))
{
FormsAuthentication.RedirectFromLoginPage (tboUsername.Text,PersistCookie.Checked);
}
//else
//{
// lblResults.Text = "Invalid Credentials: Please try again";
//}
}
</script>
and my config file has the following lines


<forms name=".COOKIEDEMO">
loginUrl="frmMain.aspx"
protection="All"
timeout="30"
path="/"/>;
</forms>;

Does anyone know what im doing wrong
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top