ASP.NET MVC blank page | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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 } ); } } }

23rd Aug 2018, 8:41 PM
H4xor
H4xor - avatar
4 Answers
+ 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
23rd Aug 2018, 9:18 PM
Vasyl Shevaha
Vasyl Shevaha - avatar
0
the index.html is called within the home controller
24th Aug 2018, 7:07 AM
H4xor
H4xor - avatar
0
could you please show me home controller and index.html?
24th Aug 2018, 7:45 AM
Vasyl Shevaha
Vasyl Shevaha - avatar
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.
24th Aug 2018, 8:01 AM
H4xor
H4xor - avatar