Solved

How do I prevent the createuserwizard from creating the user?

Posted on 2007-11-16
1
618 Views
Last Modified: 2008-02-01
I want to stop the creation of a user ID in the user database if the created ID does not match a list of pre-authorized users.  I have a function that compares the username of the createuserwizard control to a database of authorized users.

Protected Sub CreateUserWizard1_CreatingUser(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.LoginCancelEventArgs)
        Dim chkID As Boolean
        chkID = CompareUserName()
        If chkID = False Then Exit Sub
    End Sub

I put it in creatinguser event but exiting the sub if the users do not match, does not prevent the user information from being written to the user database.  How can I interrupt this process?  I am using vs2005 and visual basic.

Thanks,
John
0
Comment
Question by:leachj
1 Comment
 
LVL 16

Accepted Solution

by:
anoyes earned 500 total points
ID: 20316851
Instead of "Exit Sub", try "e.Cancel=True"

Here's the MSDN info about that argument:
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.logincanceleventargs.cancel.aspx
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

805 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question