ConfirmAccount.cshtml in Root Folder




  var confirmationError = false;

  var confirmationToken = "";

  var message = "";


  confirmationToken = Request["confirmation"];


    if( WebSecurity.ConfirmAccount(confirmationToken) ) {

      message = "Your account has been confirmed. Thanks!";



      confirmationError = true;

      message = "There was problem while confirming your account.";




    message = "No token was supplied!";

    confirmationError = true;




<!DOCTYPE html>

<html lang="en">


    <link rel="stylesheet" href="@Href("~/")TestMembership.css" type="text/css" />

    <meta charset="utf-8" />

    <title>Confirm Account</title>



  <form method="post" action="">

  <h1>Confirm Account</h1>



  @if(confirmationError == true){

    <p>You can try entering your confirmation code here:<br/>


      <input type="text" value="" name="confirmation" /><br/>


      <input type="submit" value="Submit" name="buttonSubmit" /><br/>



  <p><a href="@Href("~/Home")">Return to home page</a></p>





Return to sample app.

Return to blog entry