Код: Выделить всё
System.InvalidOperationException
The view 'Billing' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/BillingMain/Billing.cshtml
~/Views/BillingMain/Billing.vbhtml
~/Views/Shared/Billing.cshtml
~/Views/Shared/Billing.vbhtml
~/Views/BillingMain/Billing.aspx
~/Views/BillingMain/Billing.ascx
~/Views/Shared/Billing.aspx
~/Views/Shared/Billing.ascx
Я пробовал все, чтобы это было на работе, но только продолжайте застревать.
Код: Выделить всё
Project-
AppStart-
Areas-
Billing-
Invoice-
Controllers-
Scripts-
Views-
Global.asax
< /code>
Я пока тестирую только область счетов, ниже приведена остальная часть моего кода. < /p>
routeconfig < /p>
using System.Web.Mvc;
using System.Web.Routing;
namespace WORK_GODDAMN
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
//AreaRegistration.RegisterAllAreas();
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
//,namespaces: new string[] { "WORK_GODDAMN.Areas.Controllers" }
);
}
}
< /code>
} < /p>
billingarearegistration.cs
using System;
using System.Web.Mvc;
namespace WORK_GODDAMN.Areas.Billing
{
public class BillingAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "Billing";
}
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"Billing_Default",
"Billing/{controller}/{action}/{id}",
new {controller = "BillingMain", action = "Index", id = UrlParameter.Optional }
, namespaces: new string[] { "WORK_GODDAMN.Areas.Billing.Controllers" }
);
}
}
}
< /code>
global.asax
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.Http;
namespace WORK_GODDAMN
{
public class Global : HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RouteConfig.RegisterRoutes(RouteTable.Routes);
GlobalConfiguration.Configure(WebApiConfig.Register);
}
}
}
< /code>
main _layout.cshtml Это где ссылка на действие перенаправляет и считаю, что я могу сделать что -то не так, здесь, но на данный момент я понятия не имею, что может вызвать проблему. < /p>
@using System.Web.Optimization
@ViewBag.Title
@Scripts.Render("~/Scripts/modernizr.js")
{Demo}- Pluggable Modules
@Html.ActionLink("Home","Index","Home", new {Area=""}, null)
@Html.ActionLink("Invoice","Index","InvoiceMain", new {Area=""}, null)
@Html.ActionLink("Billing","Index","BillingMain", new {Area=""}, null)
@RenderBody()
@Scripts.Render("~/Scripts/jquery.js")
@RenderSection("Scripts", required: false)
Подробнее здесь: https://stackoverflow.com/questions/448 ... looking-in