Sheikh parvaz

Sheikh parvaz

  • NA
  • 199
  • 105.7k

Login control

Nov 6 2012 6:26 AM
 

using

System;

using

System.Collections.Generic;

using

System.Linq;

using

System.Web;

using

System.Web.UI;

using

System.Web.UI.WebControls;

using

System.Web.Security;

namespace

Supportticketsystem.Account

{

public partial class Login : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

}

protected void LoginUser_Authenticate(object sender, AuthenticateEventArgs e)

{

TextBox txtBox = (TextBox)LoginUser.FindControl("UserName");

if (Roles.IsUserInRole(txtBox.Text, "User"))

{

Response.Redirect(

"/Users/UserIndex.aspx");

if (Roles.IsUserInRole(txtBox.Text, "Administrator"))

{

Response.Redirect(

"AdminIndex.aspx");

if (Roles.IsUserInRole(txtBox.Text, "Expert"))

{

Response.Redirect(

"ExpertIndex.aspx");

}

}

}

}

}

}



 

Kindly help me with the above program. As it running without errors but the purpose is not met. As it is obvious in the program I want to redirect the users to perticular pages by customising the login control. But it is redircting to the same Default page.

 


Answers (3)