protected
void SetDestinationUrl(object sender, EventArgs e)
{
TextBox txtBox = (TextBox)LoginUser.FindControl("UserName"); if (Roles.IsUserInRole(txtBox.Text, "Guest"))
{
Response.Redirect(
"UserIndex.aspx");
if (Roles.IsUserInRole(txtBox.Text, "Administrator"))
{
Response.Redirect(
"AdminIndex.aspx");
}
}
The above code is showing me error by saying "The type or namespace anme IsUserInRole does not exist....."
Kindly help me out of it..

Sandeep Singh ShekhawatPosted Oct 13, 2012, 9:05 AM
Its running successful on my system please chaeck inherits attribute on .aspx page under page directive.
Inherits="Supportticketsystem.Account.Login"
Sheikh parvazPosted Oct 13, 2012, 9:11 AM
Sheikh parvazPosted Oct 13, 2012, 8:44 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 SetDestinationUrl(object sender, EventArgs e)
{
TextBox txtBox = (TextBox)LoginUser.FindControl("UserName"); if (Roles.IsUserInRole(txtBox.Text, "Guest"))
{
Response.Redirect(
"UserIndex.aspx");
if (Roles.IsUserInRole(txtBox.Text, "Administrator"))
{
Response.Redirect(
"AdminIndex.aspx");
}
}
}
}
}
This is the whole program.
Sheikh parvazPosted Oct 13, 2012, 8:39 AM
Sandeep Singh ShekhawatPosted Oct 13, 2012, 8:38 AM
using System.Web.Security;