asp.netcreateuserwizard

CreateUserWizard's LoginCreatedUser=false and email sending doesn't work


In CreateUserWizard I have set:

DisableCreatedUser="True" 
LoginCreatedUser="False"

but the user is logged on after it is created.

and also for sending a verification email I have added:

   <MailDefinition BodyFileName="~/EmailTemplates/NewAccountTemplate.htm" From="info@test.com" IsBodyHtml="True" Subject="Registration">
   </MailDefinition>

but no email is sent and even OnSendingMail is not fired.

Please help me.


Solution

  • The problem was this default code in Register.aspx.cs

    formsauthentication.setauthcookie(registeruser.username, false /* createpersistentcookie */);
    string continueurl = registeruser.continuedestinationpageurl;
    if (string.isnullorempty(continueurl))
    {
       continueurl = "~/";
    }
    response.redirect(continueurl);