Hello
When a new user registers on my sign-up.aspx page, he received this on-screen message: 'Your account has been successfully created. You will receive an e-mail with a confirmation link that you need to click to confirm your e-mail address and activate your account.'
I wish to remove that text as I have it on another page the user is redirected to called success_test.aspx. When I have tried to remove the text on my sign-up.aspx page, I got a server error in Visual Studio 2017.
This is the aspx code I have on my sign-up page:
and this is in my aspx.cs file:
Any help would be appreciated.
Thanks!
When a new user registers on my sign-up.aspx page, he received this on-screen message: 'Your account has been successfully created. You will receive an e-mail with a confirmation link that you need to click to confirm your e-mail address and activate your account.'
I wish to remove that text as I have it on another page the user is redirected to called success_test.aspx. When I have tried to remove the text on my sign-up.aspx page, I got a server error in Visual Studio 2017.
This is the aspx code I have on my sign-up page:
C#:
<form id="form1" runat="server">
<div>
<asp:CreateUserWizard ID="CreateUserWizard1" runat="server" DisableCreatedUser="True" OnCreatedUser="CreateUserWizard1_CreatedUser" OnSendingMail="CreateUserWizard1_SendingMail" CompleteSuccessText="Your account has been successfully created. You will receive an e-mail with a confirmation<br>
link that you need to click to confirm your e-mail address and activate your account.">
<MailDefinition BodyFileName="~/App_Data/YourNewAccount.txt" From="info@mysite.net" Subject="Your new account">
</MailDefinition>
<WizardSteps>
<asp:CreateUserWizardStep runat="server" />
<asp:CompleteWizardStep runat="server" />
</WizardSteps>
</asp:CreateUserWizard>
</div>
</form>
and this is in my aspx.cs file:
C#:
public partial class SignUp : System.Web.UI.Page
{
string accountConfirmationKey = string.Empty;
protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
{
ProfileCommon userProfile = ProfileCommon.Create(CreateUserWizard1.UserName) as ProfileCommon;
accountConfirmationKey = Guid.NewGuid().ToString();
userProfile.AccountConfirmationKey = accountConfirmationKey;
userProfile.Save();
}
protected void CreateUserWizard1_SendingMail(object sender, MailMessageEventArgs e)
{
string confirmLink = string.Format("{0}://{1}/Confirm.aspx?ConfirmationKey={2}&UserName={3}", Request.Url.Scheme, Request.Url.Authority, accountConfirmationKey, CreateUserWizard1.UserName);
e.Message.Body = e.Message.Body.Replace("##ConfirmLink##", confirmLink);
}
}
Any help would be appreciated.
Thanks!