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.

Shivanand ArurPosted Nov 6, 2012, 7:52 AM
http://aspnet.4guysfromrolla.com/articles/082703-1.aspx
http://aspnet.4guysfromrolla.com/articles/082703-1.2.aspx
Thank you.
Sheikh parvazPosted Nov 6, 2012, 7:28 AM
Riddhi ValechaPosted Nov 6, 2012, 6:59 AM
Can you send me your code? Also, let me know that from where the system is checking the username, password and the role.
If you are sending me the code, also send the .bak file of database.
Take a backup so that I just restore it.
And what is the method - IsUserInRole() ??
What is the function body?