I have created and host nvc3 web app now problem is when I open my
www.abc.comit is opening index.cshtml i.e home page of mvc web app
but I dont want that to be open when I open
www.abc.comI have one static page called
index.htmshould be open first
in mvc3 Global.asax code:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
}
How can I render to
http://www.abc.com/mypage.html
Jignesh TrivediPosted Apr 11, 2012, 7:02 AM
try below step.
1) Add new route top of all routes and in route pass your html page path (RegisterRoutes function of globle.asax).
routes.MapPageRoute("Default1", "", "~/myhtml.html");
2)Register html path tin web config.
....
....
now try..
hope this help.
ravi kambojPosted Apr 11, 2012, 5:24 AM
You can also use RedirectToAction methods.