Yogesh Vedpathak

Yogesh Vedpathak

  • 677
  • 1.3k
  • 154.4k

Redirect To Static Html Page

Dec 25 2017 3:59 AM
How to Redirect From Asp.net Mvc To Html Page 
code is below 
When I want click button Contact It will Redirect to Html Page  
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace Sendsms.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
public ActionResult About()
{
return RedirectToRoute("About.html");
}
public ActionResult Contact() 
{
var staticPageToRender = new FilePathResult("~/Html/index.html", "text/html");
return staticPageToRender;
// return View();
}
}
}
 

Answers (2)