asp.net-mvc-areas

Areas over multiple projects - Views not found in child projects

梦想的初衷 提交于 2019-12-01 23:09:39
问题 I've been following this guide from MSDN about "Creating an ASP.NET MVC Areas Application Using Multiple Projects". Since ASP.NET MVC 2.0 is just preview one would imagine there to be some bugs. My problem is, it simply doesn't work! At least not the way it's suppose to. After setting everything up and pressing F5, one would think that, this will work, neat! BEEEP. Wrong. It doesn't find the Views in the child project! Because in my case it tries to search within ~/Views which of course is in

Areas over multiple projects - Views not found in child projects

给你一囗甜甜゛ 提交于 2019-12-01 21:09:50
I've been following this guide from MSDN about "Creating an ASP.NET MVC Areas Application Using Multiple Projects" . Since ASP.NET MVC 2.0 is just preview one would imagine there to be some bugs. My problem is, it simply doesn't work! At least not the way it's suppose to. After setting everything up and pressing F5, one would think that, this will work, neat! BEEEP. Wrong. It doesn't find the Views in the child project! Because in my case it tries to search within ~/Views which of course is in the parent! When debugging i see that it Does run the Controller inside my child project, but when

Bind a Global Action Filter to all Controllers in an Area using MVC 3 Dependency Injection with Ninject 2.2

烂漫一生 提交于 2019-12-01 06:36:53
I was able to to use ASP.NET MVC 3 and Ninject 2.2 to inject a logger object into a custom ActionFilterAttribute thanks to the help I received in this post . Now I would like to bind my custom ActionFilterAttribute only to all controllers that are in a specific area. I was able to get started with the following binding but it only handles one controller in a certain area. I would like my code to bind to all controllers in a specific area. Any ideas? /// <summary> /// Load your modules or register your services here! /// </summary> /// <param name="kernel">The kernel.</param> private static

What is wrong with my area routing in my bin deployed MVC4 app?

谁说我不能喝 提交于 2019-12-01 05:25:55
I have just deployed an MVC4 .NET 4.0 app to my web host, for 'live' deployed testing. Non -area routes are working fine, e.g. my @Html.ActionLink("Register as a Client", "Register", "Account", new { registrationType = "Client"}, null) link works fine, and the link opens the correct page. However, with a link to an area based action like this: @Html.ActionLink("Authors", "Index", "Home", new { Area = "Author", registrationType = "Author" }, null) the link actually rendered to the browser is missing action and controller, i.e. http://mylivedomain.com/?Area=Author&registrationType=Author It may

Bind a Global Action Filter to all Controllers in an Area using MVC 3 Dependency Injection with Ninject 2.2

纵饮孤独 提交于 2019-12-01 04:58:07
问题 I was able to to use ASP.NET MVC 3 and Ninject 2.2 to inject a logger object into a custom ActionFilterAttribute thanks to the help I received in this post. Now I would like to bind my custom ActionFilterAttribute only to all controllers that are in a specific area. I was able to get started with the following binding but it only handles one controller in a certain area. I would like my code to bind to all controllers in a specific area. Any ideas? /// <summary> /// Load your modules or

Area-global filters in MVC 3

心不动则不痛 提交于 2019-12-01 04:32:05
Since it doesn't appear to be supported natively, what's the recommended way of implementing global filters on a per-area basis? You could use a custom IFilterProvider . Levi The reason it's not supported natively is because we want to discourage developers from doing it. Areas are not associated with controllers; they're associated with routes . We wanted to discourage developers from trying to apply authorization or other security-sensitive filters to areas since they can be bypassed. See How can we set authorization for a whole area in ASP.NET MVC? for more information. 来源: https:/

What is wrong with my area routing in my bin deployed MVC4 app?

ε祈祈猫儿з 提交于 2019-12-01 03:10:20
问题 I have just deployed an MVC4 .NET 4.0 app to my web host, for 'live' deployed testing. Non -area routes are working fine, e.g. my @Html.ActionLink("Register as a Client", "Register", "Account", new { registrationType = "Client"}, null) link works fine, and the link opens the correct page. However, with a link to an area based action like this: @Html.ActionLink("Authors", "Index", "Home", new { Area = "Author", registrationType = "Author" }, null) the link actually rendered to the browser is

Asp.net MVC - Render a partial View From an Area

丶灬走出姿态 提交于 2019-12-01 02:43:48
问题 I've created an area that will handle our some generic things across all our development products, just as log ins, HTML helpers, etc. Inside the area, I have a partial view that I'm attempting to reference outside of the area. I've registered the area with public class Routes : AreaRegistration { public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute( "Common_default", "Common/{controller}/{action}/{id}", new { controller = "Account", action = "Index", id =

Area-global filters in MVC 3

安稳与你 提交于 2019-12-01 02:10:32
问题 Since it doesn't appear to be supported natively, what's the recommended way of implementing global filters on a per-area basis? 回答1: You could use a custom IFilterProvider. 回答2: The reason it's not supported natively is because we want to discourage developers from doing it. Areas are not associated with controllers; they're associated with routes . We wanted to discourage developers from trying to apply authorization or other security-sensitive filters to areas since they can be bypassed.

Binding ListBox with a model in MVC3

寵の児 提交于 2019-11-30 22:01:24
My model is public class SiteConfig { public SiteConfig() { } public int IdSiteConfig { get; set; } public string Name { get; set; } public byte[] SiteLogo { get; set; } public string Brands { get; set; } public string LinkColour { get; set; } public IEnumerable<SiteBrand> SiteBrands { get; set; } } and public class SiteBrand { public int Id { get; set; } public int SiteId { get; set; } public int BrandId { get; set; } public Brand Brand { get; set; } public SiteConfig SiteConfig { get; set; } } public class Brand { public int BrandId { get; set; } public string Name { get; set; } public