I have a custom role provider & custom membership provider on my app.
Membership works okay so far, but I get an error when I try to use the role provider.
I've verified that the username (tcallahan) is in the database, and a member of the role ("Administrators") that I'm checking.
Here's the code that throws an error:
Full exception code:
Thanks in advance for any guidance.
Bryant Farley
"The Dude Abides
Membership works okay so far, but I get an error when I try to use the role provider.
I've verified that the username (tcallahan) is in the database, and a member of the role ("Administrators") that I'm checking.
Here's the code that throws an error:
Code:
MsgBox(Roles.IsUserInRole("tcallahan", "Administrator"))
Full exception code:
Code:
System.NullReferenceException was unhandled by user code
Message="Object reference not set to an instance of an object."
Source="System.Web"
StackTrace:
at System.Web.Security.RolePrincipal.IsInRole(String role)
at System.Web.Security.Roles.IsUserInRole(String username, String roleName)
at scottsdale._Default.Button1_Click(Object sender, EventArgs e) in C:\Documents and Settings\myusername\My Documents\Visual Studio 2008\Projects\tucson\scottsdale\Default.aspx.vb:line 13
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
InnerException:
Thanks in advance for any guidance.
Bryant Farley
"The Dude Abides