asp.net-mvc-routing

ASP.Net MVC routes work locally but not remotely [closed]

假如想象 提交于 2020-02-25 04:46:05
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . I know this issue has been addressed before but I have not found an answer to my situation. I have created a MVC website. When I run it locally everything works but upload it to our web sever the routes don't

ASP.Net MVC routes work locally but not remotely [closed]

狂风中的少年 提交于 2020-02-25 04:45:28
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . I know this issue has been addressed before but I have not found an answer to my situation. I have created a MVC website. When I run it locally everything works but upload it to our web sever the routes don't

Why does RedirectToRoute(“Default”) not redirect to the root?

只谈情不闲聊 提交于 2020-02-22 08:08:26
问题 Given these routes: routes.MapRoute("Test", "test", new { controller = "Test", action = "Index" }); routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); If I call RedirectToRoute("Default") from the Index action of the TestController it redirects to /test but I expected it to redirect to / I checked the result of calling RedirectToRoute("Default") before returning it during a debugging session.

Why does RedirectToRoute(“Default”) not redirect to the root?

非 Y 不嫁゛ 提交于 2020-02-22 08:05:54
问题 Given these routes: routes.MapRoute("Test", "test", new { controller = "Test", action = "Index" }); routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); If I call RedirectToRoute("Default") from the Index action of the TestController it redirects to /test but I expected it to redirect to / I checked the result of calling RedirectToRoute("Default") before returning it during a debugging session.

Why does RedirectToRoute(“Default”) not redirect to the root?

不问归期 提交于 2020-02-22 08:01:45
问题 Given these routes: routes.MapRoute("Test", "test", new { controller = "Test", action = "Index" }); routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); If I call RedirectToRoute("Default") from the Index action of the TestController it redirects to /test but I expected it to redirect to / I checked the result of calling RedirectToRoute("Default") before returning it during a debugging session.

Lowercase URLs without affecting parameters

走远了吗. 提交于 2020-01-31 07:07:20
问题 I'm currently using ASP.NET MVC 4 Routing with the LowercaseUrls option set to true and it's working great. I'm using this configuration: routes.LowercaseUrls = true; routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Inicio", action = "Index", id = UrlParameter.Optional }); But in a particular set of actions, I have a string id parameter that is encrypted and case-sensitive. Then, when I try to generate an action link like this: @Html

How can I combine a MVC4 site and a WebAPI site under the same IIS website?

无人久伴 提交于 2020-01-31 05:49:04
问题 I have a project (named Product.Api ) that has some controllers used for our WebAPI site. The controllers are in a namespace Product.Api.Controllers . The project also has some other helper stuff as well. This is compiled into a library. I also have another regular ASP.NET MVC4 website named Product.Web . This has Controllers (under the namespace Product.Web.Controllers ), Models and Views (in its corresponding folders). It also has a Global.asax.cs which has the routing information. When the

How can I combine a MVC4 site and a WebAPI site under the same IIS website?

放肆的年华 提交于 2020-01-31 05:48:46
问题 I have a project (named Product.Api ) that has some controllers used for our WebAPI site. The controllers are in a namespace Product.Api.Controllers . The project also has some other helper stuff as well. This is compiled into a library. I also have another regular ASP.NET MVC4 website named Product.Web . This has Controllers (under the namespace Product.Web.Controllers ), Models and Views (in its corresponding folders). It also has a Global.asax.cs which has the routing information. When the

How to modify ASP NET Web API Route matching to allow parameters with slashes inside?

余生颓废 提交于 2020-01-24 15:10:43
问题 We're using RavenDB on the backend and so all the DB keys are strings that contain forward slashes e.g. users/1 . AFAIK there's no way to use the default ASP NET Web API route matching engine to match a parameter like this, without using a catch-all which means the key must be the last thing on the URL. I tried adding a regex constraint of users/d+ but it didn't seem to make a difference, the route wasn't matched. What bits would I have to replace to do just enough custom route matching to

Manually pass a url through the modelbinder to obtain the RouteData parameters

一个人想着一个人 提交于 2020-01-24 13:07:43
问题 I have a complex ASP.NET MVC routing scenario and I want to be able to parse a URL that I pull from the 'Referrer' request header using the existing routes. I have incoming requests that look like this: http://hostname/{scope}/{controller}/{action} With corresponding route mapping: routes.MapRoute( name: "scoped", url: "{scope}/{controller}/{action}/{id}", defaults: new { controller = "Equipment", action = "Index", id = UrlParameter.Optional, scope = "shared" } ); In the OnActionExecuting