C
Cirene
I'm creating my own create user wizard.
Here's my code...
If Membership.GetUser(txtEzUsername.Text).ProviderUserKey.ToString
<> "" Then
Me.lblStatus.Text = "Username is in use. Please select another
Username."
Exit Sub
End If
Here's the error:
System.NullReferenceException was unhandled by user code
Message="Object reference not set to an instance of an object."
Source="App_Web_5nh_bhxb"
StackTrace:
at NewUserWizard.cmdCreate_Click(Object sender, EventArgs e) in
F:\work-related\websites\Lexitel\NewUserWizard.aspx.vb:line 87 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:
How can I check if GetUser returns nothing (ie the user doesnt exist)?
Thanks.
Here's my code...
If Membership.GetUser(txtEzUsername.Text).ProviderUserKey.ToString
<> "" Then
Me.lblStatus.Text = "Username is in use. Please select another
Username."
Exit Sub
End If
Here's the error:
System.NullReferenceException was unhandled by user code
Message="Object reference not set to an instance of an object."
Source="App_Web_5nh_bhxb"
StackTrace:
at NewUserWizard.cmdCreate_Click(Object sender, EventArgs e) in
F:\work-related\websites\Lexitel\NewUserWizard.aspx.vb:line 87 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:
How can I check if GetUser returns nothing (ie the user doesnt exist)?
Thanks.