Click here to Skip to main content
15,906,645 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionRequired Payment Gateway API http://www.interswitchng.com Pin
Ashish Sehajpal25-May-08 20:27
Ashish Sehajpal25-May-08 20:27 
AnswerRe: Required Payment Gateway API http://www.interswitchng.com Pin
N a v a n e e t h25-May-08 20:44
N a v a n e e t h25-May-08 20:44 
Questionapp_code folder Pin
Pankaj Garg25-May-08 19:36
Pankaj Garg25-May-08 19:36 
AnswerRe: app_code folder Pin
Blue_Boy25-May-08 19:47
Blue_Boy25-May-08 19:47 
AnswerRe: app_code folder Pin
N a v a n e e t h25-May-08 19:58
N a v a n e e t h25-May-08 19:58 
QuestionRe: app_code folder Pin
Pankaj Garg25-May-08 20:31
Pankaj Garg25-May-08 20:31 
AnswerRe: app_code folder Pin
N a v a n e e t h25-May-08 20:40
N a v a n e e t h25-May-08 20:40 
QuestionAuthorizaton in ASP.NET 2.0 Pin
salon25-May-08 19:26
salon25-May-08 19:26 
I have a login page where I have my own label and texboxes which take input username and password, and there is a function in which there is a SP which validates username and password stored in the database.

My code in Login.aspx.cs is such that I call that function and validates username and password and redirects to next page Page2.aspx.

Now I want my site to be authorized such that if a user tries to access internal pages he couldn't be able to do that.

I have code in my WEb.config for that is

<authentication mode="Forms">

<forms cookieless="UseCookies" timeout="525600">

<authorization>

<deny users="?">
<allow users="*">


and code in login.aspx.cs is

protected void btnLogin_Click(object sender, EventArgs e)
{
validateUser = validateUser.ValidateUser(txtUserName.Text, hashedPassword);

if (Page.IsValid)
{
if (validateUser != null)
{



Response.Redirect("~/Page2.aspx");


}
else
{
lblErrorMessage.Text = "Invalid User";
}
}
}

Now when I try to run internal pages without login it automatically redirects to login page which is fine but when I put valid username and password in the login page it redirects with some "ReturnUrl" and not able to redirect to the Page2.aspx page.This is my problem.
Can anybody tell me where I am doing wrong or need to change the code somewhere?
Thanks in advance,
QuestionRe: Authorizaton in ASP.NET 2.0 Pin
Vasudevan Deepak Kumar26-May-08 18:51
Vasudevan Deepak Kumar26-May-08 18:51 
AnswerRe: Authorizaton in ASP.NET 2.0 Pin
salon26-May-08 19:26
salon26-May-08 19:26 
QuestionAJAX ISSUE...URGENT HELP REQUIRED FROM AJAX EXPERTS Pin
Sajid A.25-May-08 18:47
Sajid A.25-May-08 18:47 
AnswerCP Members IGNORE Pin
leckey25-May-08 18:51
leckey25-May-08 18:51 
AnswerRe: AJAX ISSUE...URGENT HELP REQUIRED FROM AJAX EXPERTS Pin
Ashish Sehajpal25-May-08 20:30
Ashish Sehajpal25-May-08 20:30 
Questionvirtual directories c# Pin
Pankaj Garg25-May-08 18:11
Pankaj Garg25-May-08 18:11 
AnswerRe: virtual directories c# Pin
Laddie25-May-08 19:03
Laddie25-May-08 19:03 
AnswerRe: virtual directories c# Pin
Abhijit Jana25-May-08 19:05
professionalAbhijit Jana25-May-08 19:05 
QuestionRe: virtual directories c# Pin
Pankaj Garg25-May-08 19:25
Pankaj Garg25-May-08 19:25 
AnswerRe: virtual directories c# Pin
Abhijit Jana25-May-08 19:30
professionalAbhijit Jana25-May-08 19:30 
QuestionRe: virtual directories c# Pin
Pankaj Garg25-May-08 19:43
Pankaj Garg25-May-08 19:43 
AnswerRe: virtual directories c# Pin
Abhijit Jana25-May-08 19:52
professionalAbhijit Jana25-May-08 19:52 
QuestionRe: virtual directories c# Pin
Pankaj Garg25-May-08 19:57
Pankaj Garg25-May-08 19:57 
AnswerRe: virtual directories c# Pin
N a v a n e e t h25-May-08 20:05
N a v a n e e t h25-May-08 20:05 
AnswerRe: virtual directories c# Pin
Laddie25-May-08 19:58
Laddie25-May-08 19:58 
GeneralRe: virtual directories c# Pin
Abhijit Jana25-May-08 20:01
professionalAbhijit Jana25-May-08 20:01 
GeneralRe: virtual directories c# Pin
N a v a n e e t h25-May-08 20:04
N a v a n e e t h25-May-08 20:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.