RSS Forums RSS
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting

Updated : Simple ASP.Net Login Page

Join Date: Feb 2003
Location: Canada
Posts: 786
Reputation: Paladine has a spectacular aura about Paladine has a spectacular aura about Paladine has a spectacular aura about 
Rep Power: 9
Solved Threads: 25
Colleague
Paladine's Avatar
Paladine Paladine is offline Offline
Master Poster

Re: Updated : Simple ASP.Net Login Page

  #44  
Jun 17th, 2005
Note

Oh, one last point. You do not have to use the FormsAuthentication.RedirectFromLogin line of code in your application(s).

Use Response.Redirect, if my method is causing an issue.

It is the logic and understanding that matters, not so much the method you use to get there.

Originally Posted by leTus
Ok, I was reading and I don't know if I got this right but millers_35 if your problem is that you get redirected to default.aspx even if you didn't come from there here is what I found:
This is what everybody has in their Login.aspx
FormsAuthentication.RedirectFromLoginPage(txtUserName.Text, false);
But the RedirectFromLoginPage works right if you pass the "ReturnUrl" parameter otherwise it will redirect you to Default.aspx everytime you entered the right username and password.
This should be in the page you want to protect. In this case the page name is TestDetails.aspx
if (Session["Logged_IN"].Equals("No"))
			{
				Response.Redirect("../Members/Login.aspx?ReturnUrl=/mdb/Admin/TestDetails.aspx");

			}

the code is in C# sorry no time to change.
Assistant Manager, Regional Pharmacy Information Systems
TLC Services Website (Under Construction)
Updated : ASP.Net Login Code
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 11:50 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC