0
ASP.NET MVC blank page
I have a webpage configured with all the necessary controllers,models,views and a database. However whenever i run the page, all i get is a blank page.I tend to imagine the problem is on my routeConfig.cs but i can;t figure it out. Here it is using System.Web.Mvc; using System.Web.Routing; namespace TOURS { public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( name: "Default", url: "", defaults: new { controller = "Home", action = "index", id = UrlParameter.Optional } ); } } }
4 odpowiedzi
+ 1
Hi. Why value of “url” parameter in method MapRoute is empty?
Try to set it’s value to "{controller}/{action}/{id}"
https://docs.microsoft.com/ru-ru/aspnet/mvc/overview/older-versions-1/controllers-and-routing/asp-net-mvc-routing-overview-cs
0
the index.html is called within the home controller
0
could you please show me home controller and index.html?
0
ive been looking at it and i realised on the public ActionResult Index()
{
return file("~/Client/index.html","text/html");
}
i had not defined the path correctly.