Solved

How do I prevent the createuserwizard from creating the user?

Posted on 2007-11-16
1
625 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
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.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

717 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