Skip to main content
How are we doing? Please help us improve Stack Overflow. Take our short survey

All Questions

Filter by
Sorted by
Tagged with
3 votes
1 answer
3k views

Allow string ID with ASP.NET MVC route

I have the 2 following routes setup and they are working fine when a valid request is sent. config.Routes.MapHttpRoute("DefaultApiWithId", "{controller}/{id}", new { id = RouteParameter.Optional }, ...
Dan Hastings's user avatar
  • 3,300
1 vote
2 answers
348 views

ASP.NET 4 MVC Routes 404

I am getting a 404 error on my page. What am I missing? Global.asax.cs: protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RouteConfig....
user2928262's user avatar
0 votes
1 answer
263 views

How to use short urls for categories in MVC

Short urls containing product categories like http://example.com/Computers Should used in ASP.NET MVC 4 shopping cart. If there is no controller, Home Index method with id parameter as Computers ...
Andrus's user avatar
  • 28k
3 votes
1 answer
5k views

Dynamic routing action name in ASP.NET MVC

I would like to create a dynamic routing to a URL like following: http://localhost:51577/Item/AnyActionName/Id Please note that the controller name is static and doesn't need to be dynamic. On the ...
User987's user avatar
  • 3,825
1 vote
1 answer
3k views

ASP.NET MVC Routing - Redirect to Route when Action Name and Url is same

I need to redirect on different action based on role. I have made following changes to RouteConfig.cs. RouteConfig.cs routes.MapRoute( name: "borrower", url: "...
Zeeshan's user avatar
  • 639
-1 votes
2 answers
817 views

C# MVC Create route for all methods? [closed]

Old I have created a new route for my application, which is as follows routes.MapRoute( name: "Default", url: "{custom}/{controller}/{action}/{id}", ...
foxtrot2nov's user avatar
2 votes
1 answer
2k views

Redirect special characters to their "escaped URL form"

A URL on my site (ASP.NET MVC 4.6) looks the following: /test/sog However, my site is Danish, so I'd like to redirect the Danish special character 'ø' to 'o' in all URL's. In the above case, the ...
J. Doe's user avatar
  • 687
4 votes
1 answer
1k views

Language-specific Default URL using MVC's Attribute Routing and RouteLocalization.mvc

I would like to be able to create a succinct language-specific default URL for my website so that when someone browses to: somesite.com They get redirected to a language-culture page such as: ...
SqlDataboy's user avatar
1 vote
2 answers
98 views

C# MVC - Routing Issue / Confusion

I am developing one application in the ASP.NET MVC C# on the .NET 4 framework. I confused in routing and I do the research and developed the one demo version It works as I want but I want to know is ...
Kalpesh Rajai's user avatar
1 vote
1 answer
76 views

ASP.NET MVC4 "wants" a tailing slash for my custom route [duplicate]

I have the following routes in my ASP.NET MVC application: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( ...
Flai's user avatar
  • 180
0 votes
2 answers
1k views

Asp.net MVC 4.0 : How to define seperate url for assets like JS, CSS and Images in Asp.NET MVC 4.0?

I am newbiee in asp.net MVC 4.0, As I am developing a web application using it, my application is pulling correctly in debuging mode how ever when I am pulling it via IIS it is displaying the page ...
Alok Kumar Nikhil's user avatar
1 vote
1 answer
150 views

How to have specific routing in asp.net mvc 4

I would like to know how to have specific adrressing in MVC.net 4 I have 3 url types in my web application 1-www,site.com/rss.xml 2-www.site.com/amir (this type of addresses are reserved for my ...
Amir Golpa's user avatar
1 vote
1 answer
2k views

Correct usage of MVC route id parameter

I would like to do the following in asp.net mvc: myquizsite.com/quizzes - list quizzes available myquizsite.com/quizzes/quiz1 - list previous instances of quiz1 myquizsite.com/...
user2424495's user avatar
1 vote
1 answer
734 views

Relative links and URL rewrite in ASP.NET MVC

I have an ASP.NET MVC application that's used by different companies. The URL for the app looks something like this: http://myapp.com/companyA/stuff or http://myapp.com/companyB/stuff. I get the ...
user1044169's user avatar
  • 2,858
5 votes
1 answer
546 views

Pre-Append Route if not available

We have implemented a localized version of an ASP.NET MVC website which has a URL structure as following: url://{language}-{culture}/{controller}/{action}/{id} In this way we can generate URLs by ...
Raffaeu's user avatar
  • 7,003

15 30 50 per page
1
2 3 4 5 6