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.


Riddhi ValechaRank #794 · 2.9K reputationPosted Nov 6, 2012, 1:59 AM EST
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?
Sheikh parvazRank #9,090 · 211 reputationPosted Nov 6, 2012, 2:28 AM EST
Shivanand ArurRank #920 · 2.3K reputationPosted Nov 6, 2012, 2:52 AM EST
http://aspnet.4guysfromrolla.com/articles/082703-1.aspx
http://aspnet.4guysfromrolla.com/articles/082703-1.2.aspx
Thank you.