title: How do I redirect to HTML page from within a controller?
body: <p>Users receive an email with link that they must click on in order to certify their email address.  Once the link is clicked, the user should be redirected to one of two static HTML pages, one saying &quot;You're certified&quot; the other stating &quot;The link is expired&quot;</p>
  <p>I have attempted a few options.  The first I added a <code>Response.Redirect</code> to my controller with a path to the View.  I also tried where I added a <code>routes.MapPageRoute</code> to my <code>RouteConfig</code> file and changed my redirect call to attempt to use this name, but that doesn't work either. I looked at this example for that fix ( <a href="https://stackoverflow.com/questions/13862805/redirect-to-an-html-page-inside-views-folder">Redirect to an html page inside Views Folder</a> )</p>
  <p>Here is my code attempting to access the HTML file with the redirect:</p>
  <pre><code>EmailCertification.UpdateDBEmailCertified(userName, int.Parse(memberNumber), certSentDT);
  
  return Redirect(&quot;~/Views/EmailCertification/EmailCertified.html&quot;);`
  </code></pre>
  <p>The error I get is that:</p>
  <blockquote>
  <p>Path to /Views/EmailEmailCertification/EmailCertified.html is not found.  I verified the spelling and the path is all is correct.</p>
  </blockquote>
  <p>If I changed my code to include MapPageRoute in RoutesConfig it still doesn't work.</p>
  <p>Here is my route config:</p>
  <pre><code>routes.MapPageRoute(&quot;HtmlPage&quot;, &quot;EmailCertifiedURL&quot;, &quot;~/Views/EmailCertification/EmailCertied.html&quot;);`
  </code></pre>
  <p>Here is my controller:</p>
  <pre><code>return Redirect(&quot;EmailCertifiedURL&quot;);
  </code></pre>
  <p>Here is my controller in action, it is a HttpPost</p>
  <pre><code>public ActionResult EmailCertify(string userName, string memberNumber, string certSentDate)
          {
              DateTime certSentDT;
  
              long lngCertSent = long.Parse(certSentDate);
  
              certSentDT = new DateTime(lngCertSent);
  
              if (certSentDT &lt; DateTime.Now.AddDays(-14))
                  return Redirect(&quot;EmailOldURL&quot;);
  
              EmailCertification.UpdateDBEmailCertified(userName, int.Parse(memberNumber), certSentDT);
              return Redirect(&quot;~/Views/EmailCertification/EmailCertified.html&quot;);
          }
  </code></pre>
  <p>The error I get on this is that</p>
  <blockquote>
  <p>the controller doesn't have a action EmailCertifiedURL.  This code I took from the above mentioned StackFlow article.</p>
  </blockquote>
  <p>All I want is the email link to fire off the controller action EmailCertify and redirect me to a static HTML page.</p>
  <pre><code>https://localhost:44344/EmailCertification/EmailCertify?userName=IS&amp;memberNumber=3000050&amp;certSentDate=636959314302036120 
  </code></pre>