MVC 2 我们可以轻松地创造领域。 现在,我的问题涉及nes地区(地区内)。
选择我的“father
area rafter, Right-mouse-click >Add
> NO Options for a new Area
。
能否以某种其他方式做到这一点? 或者在不久的将来能够提供这一选择?
MVC 2 我们可以轻松地创造领域。 现在,我的问题涉及nes地区(地区内)。
选择我的“father
area rafter, Right-mouse-click >Add
> NO Options for a new Area
。
能否以某种其他方式做到这一点? 或者在不久的将来能够提供这一选择?
我认识到这是一个老问题,但是,如果有人试图把这个问题排除在外,我会回答这个问题。 解决办法是创造比地区低使用不同航道价值的地区,例如,你的航道会看像:
public class RouteConfig
{
/// <summary>
/// A function that registers the default navigation route.
/// </summary>
/// <param name="routes">The RouteCollection to act on.</param>
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
var route = routes.MapRoute(
name: "Default",
url: "{area}/{subArea}/{controller}/{action}/{id}",
defaults: new { area = "DefaultArea", controller = "Home", action = "Splash", id = UrlParameter.Optional, section = "Customer" },
namespaces: new string[] { "Application.Controllers" });
}
}
你们的分地区登记之一可能认为:
public class ApplicationSubAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "ApplicationSubArea";
}
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"SubArea_default",
"Area/SubArea/{controller}/{action}/{id}",
new { action = "Index", id = UrlParameter.Optional },
new string[] { "Application.Areas.AreaName.SubAreaName.Controllers" }
);
}
}
读完后,“地区”是否仍然像一个字? 因为这对我不利。
P.S. You can do this recursively sos soc.
url: "{area}/{subArea}/{subSubArea}/{subSubSubArea}/{evenMoreSubArea}/{controller}/{action}/{id}",
页: 1
"Area/SubArea/SubSubArea/SubSubSubArea/EvenMoreSubArea/{controller}/{action}/{id}",
页: 1
现在,没有任何信息能够说明哪些地区会被nes。
今后可能会改变这种状况。
利用Multi-project areas,作为开端,我猜测你可以再造更多的nes带。
Maybe something like this could help. It s more like a study which is in mvc-contrib. I saw it for version 1 don t know if it s compatible for MVC2 It s the concept of sub-controllers: http://mhinze.com/subcontrollers-in-aspnet-mvc/
此时此刻,
You do not want to have nested aereas. There is something wrong in your Software design.
the most common case is, that you use areas as Html Renderer, therefore are the Display Templates.
Ok, I have a role based permission system in place and would like admin s to be able to edit the permissions for each role. To do this I need to load lots of checkboxes, however I m struggling with ...
VS 2010 Beta 2, .NET 4. In my ASP.NET MVC 2 application, when I submit a form to an action method that accepts an object created by the entity framework, I get the following error: Exception Details:...
I m trying to get ASP.NET MVC 2 single-project area registration to work. Tried with Preview 2 and now with Beta version with no luck. I used the "Add area" dialog to create a "NewsModule" area. ...
I have an update controller action that checks validation. if (!ModelState.IsValid) return View(InitialiseModel(model)); My view uses UIHelpers: <%=Html.EditorForModel("MyModelTemplate") %> ...
We have a decent sized MVC project running well at the moment, i ve started to look at some re-factoring and I have a question. At the moment the Data Layer and Service Layer is stored in a seperate ...
Is there anyway when in an MVC view to right click a function call and get to the declaration? Like you can do in the code behind/controllers
I m experiencing some different behavior after switching from ASP.NET MVC 1.0 to ASP.NET MVC 2 Beta. I checked the breaking changes but it s not clear where the issue lies. The problem has to do with ...
In our current Asp.net MVC application we have 2 menu systems one accross the top and one on the left hand side. Now we have a partial view that renders the menu, however is the only way for this too ...