Hello Everyone,
I hope you can help me find the answer here. I am using forms authentication and using ASP.Net membership without any roles, standard out of the box setup. I have created a login page and would like to test if someone browses directly to the page (by using a book mark or something) that is already logged in and direct them to another page.
For example
Me as a user comes to my page and logs in, i then for some reason decide to go back to the login page. Normally dotNet will just display my login page. However i would like to redirect it do another page lets say. Already loggedin.aspx.
Now i allow users to view the entire site if they are logged in or not, i just need to know what the code C# would be in my page load to test if they are logged in or not.
This doesn't work
CODE
protected void Page_Load(object s,EventArgs e)
{
MembershipUser member = Membership.GetUser();
if(member != null)
Response.Redirect("/loggedIn.aspx");
}
If have been through so many pages that absolutely tell you NOTHING about checking if they are logged in at all. The MSDN links contain everything but what i am looking for. Help!