'Roles' does not contain a definition for 'RoleExists'

A

Arjen

What does this mean?
'Roles' does not contain a definition for 'RoleExists'

I'm doing this:
using System.Web.Security;
Roles.DeleteRole(txtRolename.Text.Trim());

I don't see what's wrong.

Hope someone can help,
Arjen
 
A

Arjen

Now it works with the complete name...
System.Web.Security.Roles.DeleteRole(txtRolename.Text.Trim());

Strange...

Arjen
 
G

Guest

Hi Arjen,

I think is does contain the definition for the same. I developed an
application where in I checked if it role already existed I prompted the same
else created a new role.

if (!Roles.RoleExists(txtBoxRole.Text))
{
// Create Role
Roles.CreateRole(txtBoxRole.Text);
// Bind the list box again after creating the role
LstBoxDBind ();
//Displaying the message for role creation
lblMessage.Visible = true;
lblMessage.Text = "Role : '" + Server.HtmlEncode(txtBoxRole.Text.ToString())
+ "' created.";
txtBoxRole.Text = "";
}

I hope my understanding is correct of your issue

regards,
anubhav
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top