Questions about routing within ASP.Net MVC
Questions tagged [mvcroutehandler]
36 questions
0
votes
1 answer
Convert ASP.NET MVC MvcRouteHandler to ASP.NET Core MVC
I have to port over the following ASP.NET MVC code to .NET Core and I'm stuck on how to do this.
This is my old ASP.NET MVC code:
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
…

zSynopsis
- 4,854
- 21
- 69
- 106
0
votes
1 answer
Overriding the default Route in MVC
Is there any way to override the default routing(~/home/index) without changing anything RouteConfig.cs, that's upon ctrl+F5, the page has to open the route we want.

Praveen
- 1
- 3
0
votes
1 answer
MVC3 RouteHandler result ignores Area in the resolved Route - why?
I am working on splitting an MVC3 Application into two Areas. The existing application is going into one area (V1) and we are beginning a redesign in the second area (V2).
I have the Views, Models, Controllers, etc all moved into the…

rswafford
- 374
- 3
- 8
0
votes
1 answer
How can I get ASP.NET MVC radio buttons to respond to a case insensitive route, or from directions from the controller?
I have an ASP.NET MVC app wherein I want a certain radio button to be checked based on information supplied in the URL. But (and this is key...), I want the right radio button to be checked regardless of the case of the supplied route parameter. …

Derek Rutter
- 81
- 10
0
votes
1 answer
Redirecting Response asynchronously in Custom HttpHandler ASP.Net MVC 5
When response is redirected through Task aync and await.Redirection cannot not be seen on client side(Browser). Browser is waiting for response always. Basically I created a custom HttpHandler which is furthur returning MVCHandler thus it is…

Rajput
- 2,597
- 16
- 29
0
votes
1 answer
.net core custom routing with GET parameter
.Net Core MVC, assume a custom route something like this:
App.UseMvc(routes =>
{
routes.MapRoute(
name: "fantasyBoardArea",
//constraints: "{area=FantasyDraftBoard}/{controller=Test}/{league?}/{id}",
template:…

dave317
- 754
- 2
- 12
- 30
0
votes
0 answers
MVC Route and Angular
I am facing a problem that is driving me crazy. I will try to be simple about the issue.
I have a project that uses MVC and Angular. The project has a page layout to signin and another to use in main project. I can't change the way the users access…

Alison Vieira
- 69
- 10
0
votes
1 answer
Redirect to dynamically added URL in MVC 5
My requirement is to redirect user to new url from old url . My entity is as follows:
public class HttpRedirect
{
[Key]
public int Id { get; set; }
[Required(ErrorMessage = "Old url is required.")]
[MaxLength(1000)]
//[Url]
…

Bhuban Shrestha
- 1,304
- 11
- 27
0
votes
3 answers
I added an area called home, moved my controller and view to it and now I can't connect to the index view
I already have controllers and views in folders under the project name. I added an Area folder and then an area inside it and called it Home and then moved my controller and index view into it. But when I connect to the index I get an error and it…

chuckd
- 13,460
- 29
- 152
- 331
0
votes
1 answer
MVC 5 - VS Community 2015 - Routing not working?
It has to be something simple that I'm missing, since this is my first try on MVC. Seems nothing works but the default route.
This were my steps:
Create new solution from an MVC5 template (Which comes with a
HomeController and a…

apacay
- 1,702
- 5
- 19
- 41
0
votes
1 answer
Multiple C# WebAPI API routes - restrict API method to one of the routes
I have multiple routes for my API like
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{token}/{controller}/{action}",
defaults: null,
constraints: null,
handler: HttpClientFactory.CreatePipeline(
…

Jacob
- 113
- 1
- 12
0
votes
1 answer
Returning Resized Image from WebImage in RouteHandler
I am routing my image and resizing them thru an imageRouteHandler.
Here is the code.
public class ImageRouteHandler : IRouteHandler
{
public IHttpHandler GetHttpHandler(RequestContext requestContext)
{
var…

Ruchan
- 3,124
- 7
- 36
- 72
0
votes
1 answer
0
votes
1 answer
MVC Routing 2 params in filename
I'm using MVC 5, I have this url:
/Joes-studio-essex
This is 2 seperate params {business}-{county}
Q1) How can i write a route to split this out??
Q2) Can anyone think of a way to deal with this url '/joes-studio-west-yorkshire', where the county is…

Alex Stephens
- 3,017
- 1
- 36
- 41
0
votes
1 answer
MVC project routing is not routing .html to custom routes
I have added a route for "privacy.html" to route to Home/Privacy in my ASP.Net MVC project. I've used this in other projects successfully, but it won't work in this one.
routes.MapRoute(
name: "privacy.html",
url:…

Matt Dawdy
- 19,247
- 18
- 66
- 91