[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How do I prevent the createuserwizard from creating the user?

Posted on 2007-11-16
1
Medium Priority
?
634 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 1500 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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

650 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