Groups > Asp .Net > ASP dotNET Security > Re: convert CreateUserWizard handler from C# to VB




convert CreateUserWizard handler from C# to VB

convert CreateUserWizard handler from C# to VB
Wed, 2 Apr 2008 22:33:12 +0000
An answer to a post found at
http://forums.asp.net/p/1089485/1629590.aspx#1629590 presents the following code
as a means for stopping the CreateUserWizard from going to the Complete step:

protected override void OnNextButtonClick(WizardNavigationEventArgs e)
        {
            try
            {
               base.OnNextButtonClick(e);
            }
            catch
            {
               e.Cancel = true;
            }
        }

I have some questions about this:
(1) Would the above handle the situation of a user canceling, the server not
transmitting the data, etc.?  
(2) Does the "e.Cancel = true" statement delete the user? (I'm
supposing not since the author of 
referenced post writes that he/she needs to use
"Membership.DeleteIUser(username, true)") to accomplish this.)
(3) If the answer to #1 is yes, if someone could translate the above into VB,
I'd appreciate it.
Post Reply
Re: convert CreateUserWizard handler from C# to VB
Thu, 3 Apr 2008 00:57:04 +0000
I don't use the CreateUserWizard so I'm not really sure but a try catch should
catch any error....

Here is the translated code.  FYI, you can translate with this site:

 http://labs.developerfusion.co.uk/convert/csharp-to-vb.aspx


ProtectedOverloadsOverridesSub OnNextButtonClick(ByVal e As
WizardNavigationEventArgs) 

    Try
        MyBase.OnNextButtonClick(e) 
    Catch
        e.Cancel = True
    EndTry
EndSub
Post Reply
Re: convert CreateUserWizard handler from C# to VB
Thu, 3 Apr 2008 05:27:14 +0000
Thanks. The site I use most of the time which I find works well is
http://www.carlosag.net/Tools/CodeTranslator/Default.aspx. It's not perfect but
I've had less problems with it than the one you listed. It produced the same
results that you gave me but for some reason it didn't look right.
Post Reply
about | contact