var
confirmationError =
false;
var
confirmationToken =
"";
var
message =
"";
confirmationToken = Request["confirmation"];
if(!String.IsNullOrEmpty(confirmationToken)){
if(
WebSecurity.ConfirmAccount(confirmationToken) ) {
message =
"Your account has been confirmed. Thanks!";
}
else{
confirmationError =
true;
message =
"There was problem while confirming your account.";
}
}
else{
message =
"No token was supplied!";
confirmationError =
true;
}
}
<!DOCTYPE
html>
<html
lang="en">
<head>
<link
rel="stylesheet"
href="@Href("~/")TestMembership.css"
type="text/css"
/>
<meta
charset="utf-8"
/>
<title>Confirm
Account</title>
</head>
<body>
<form
method="post"
action="">
<h1>Confirm
Account</h1>
<p>@message</p>
@if(confirmationError
== true){
<p>You
can try entering your confirmation code here:<br/>
<br/>
<input
type="text"
value=""
name="confirmation"
/><br/>
<br/>
<input
type="submit"
value="Submit"
name="buttonSubmit"
/><br/>
</p>
}
<p><a
href="@Href("~/Home")">Return
to home page</a></p>
</form>
</body>
</html>
Return to sample app.
Return to blog entry