areas

Location of JavaScript files in ASP.NET Core Areas

喜夏-厌秋 提交于 2019-12-07 16:00:36
I am creating an ASP.NET Core application that will contain several areas. Where would I add JavaScript files that are specific to a certain area (usually I put them into the wwwroot\js Folder. Is there something like this for an area?)? "Where would I add JavaScript files"? Answer is you can choose your location based on your requirements and convenience. Default location is content root i.e. wwwroot folder and its subfolders however ASP.Net Core doesn't stop you from placing those static files outside "wwwroot" folder. However if you want to place it outside default content folder i.e.

MVC with Areas — Html.ActionLink returning wrong URL/Route?

有些话、适合烂在心里 提交于 2019-12-07 01:52:29
问题 I am using MVC3 and have Areas in my application. In general, everything works fine, I can navigate to my area (e.g. Admin=Area, Controller=Department) like this: <%: Html.ActionLink("Departments", "DepartmentIndex", "Department", new { area = "Admin"}, null )%> However, what I noticed is that if I don't specify the area in my ActionLink, e.g. <%: Html.ActionLink("Test", "Index", "Home")%> This will stop working if I have navigated to the "Admin" area. i.e. my url is now http://localhost

Areas in asp.net mvc, only one work at time

牧云@^-^@ 提交于 2019-12-06 09:01:21
My folder look like this: (root)/Areas/Admin/Views/.. (root)/Areas/Admin/Controllers/... (root)/Areas/Admin/Routes.cs (root)/Areas/Forum/Views/.. (root)/Areas/Forum/Controllers/... (root)/Areas/Forum/Routes.cs public class Routes : AreaRegistration { public override string AreaName { get { return "Admin"; } } public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute( "Admin_Default", "{controller}/{action}/{Id}", new { controller = "Admin", action = "Index", Id = (string)null } ); } } public class Routes : AreaRegistration { public override string AreaName { get {

MVC with Areas — Html.ActionLink returning wrong URL/Route?

醉酒当歌 提交于 2019-12-05 08:22:23
I am using MVC3 and have Areas in my application. In general, everything works fine, I can navigate to my area (e.g. Admin=Area, Controller=Department) like this: <%: Html.ActionLink("Departments", "DepartmentIndex", "Department", new { area = "Admin"}, null )%> However, what I noticed is that if I don't specify the area in my ActionLink, e.g. <%: Html.ActionLink("Test", "Index", "Home")%> This will stop working if I have navigated to the "Admin" area. i.e. my url is now http://localhost/myproj/Admin/Home/Index instead of http://localhost/myproj/Home/Index Any ideas on what is going on here?

ASP.NET MVC 2 Preview 2: Areas duplicate controller problem

时光总嘲笑我的痴心妄想 提交于 2019-12-04 13:34:10
问题 I am continuing to enslave the MVC 2 thing: Areas... Now I have two controllers with the same name (HomeController) in the main Controllers folder and in one of the Areas. Both have different namespaces so... theoretically should coexists, but they don't. The error is: The controller name 'Home' is ambiguous between the following types: Namespace.HomeController Namespace.Areas.AreaName.Controllers.HomeController This is not related to Home controller only (special one?), but applies to any

ASP.NET MVC 2 Preview 2: Areas duplicate controller problem

只谈情不闲聊 提交于 2019-12-03 07:36:32
I am continuing to enslave the MVC 2 thing: Areas... Now I have two controllers with the same name (HomeController) in the main Controllers folder and in one of the Areas. Both have different namespaces so... theoretically should coexists, but they don't. The error is: The controller name 'Home' is ambiguous between the following types: Namespace.HomeController Namespace.Areas.AreaName.Controllers.HomeController This is not related to Home controller only (special one?), but applies to any pair in any areas. How to achieve the coexistence of the same-name-controllers within different areas?

Magento: How do I get observers to work in an external script?

不想你离开。 提交于 2019-12-03 07:30:31
问题 As far as I can tell, when a script is run outside of Magento, observers are not invoked when an event is fired. Why? How do I fix it? Below is the original issue that lead me to this question. The issue is that the observer that would apply the catalog rule is never called. The event fires, but the observer doesn't pick it up. I'm running an external script that loads up a Magento session. Within that script, I'm loading products and grabbing a bunch of properties. The one issue is that

Magento: How do I get observers to work in an external script?

核能气质少年 提交于 2019-12-02 21:02:33
As far as I can tell, when a script is run outside of Magento, observers are not invoked when an event is fired. Why? How do I fix it? Below is the original issue that lead me to this question. The issue is that the observer that would apply the catalog rule is never called. The event fires, but the observer doesn't pick it up. I'm running an external script that loads up a Magento session. Within that script, I'm loading products and grabbing a bunch of properties. The one issue is that getFinalPrice() does not apply the catalog rules that apply to the product. I'm doing everything I know to