Solved

How do I prevent the createuserwizard from creating the user?

Posted on 2007-11-16
1
615 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
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.…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now