All Questions
76 questions
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 }, ...
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....
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 ...
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 ...
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: "...
-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}",
...
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 ...
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:
...
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 ...
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(
...
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 ...
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 ...
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/...
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 ...
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 ...