Tagged Questions

14
votes
3answers
447 views

How do I return a 404 status where invalid parameters are passed to my ASP.NET MVC controller?

I want to return a HTTP status 404 if invalid arguments are passed to my controller. For example if I have a controller that looks like: public ActionResult GetAccount(int id) { ... } Then I ...
13
votes
2answers
418 views

Failing ASP.NET MVC route. Is this a bug or corner case?

I have an ASP.NET MVC 3 application where users can post suggestions along the lines of "bla bla would be better if yada yada yada". For the suggestion detail page I have defined a nice SEO friendly ...
12
votes
2answers
3k views

jQuery Mobile/MVC: Getting the browser URL to change with RedirectToAction

My first post... When I use RedirectToAction the url in the browser doesn't change. How can I achieve this? I'm switching over to ASP.NET MVC 3.0 (also using jQuery Mobile) after 10+ years using web ...
12
votes
3answers
447 views

Possible Bug With ASP.NET MVC 3 Routing?

Normally i wouldn't put a title like this in the question, but i'm pretty sure it's a bug (or by design?) I created a brand new ASP.NET MVC 3 Web Application. Then i went to the /Home/About page. ...
8
votes
3answers
310 views

Performance bottleneck Url.Action - can I workaround it?

I have an application that I recently upgraded from ASP.NET MVC1 to ASP.NET MVC4 rc1. It uses the Webforms viewengine. It has performance issues whenever Url.Action(action,controller) is used. I ...
7
votes
1answer
2k views

ASP.NET MVC 3 Areas with shared layout

I have defined an area (Admin) in my ASP.NET MVC 3 application, created _ViewStart.cshtml in that area and addedLayout = "~/Views/Shared/_Layout.cshtml"; to it to have a unified site layout. I also ...
7
votes
1answer
5k views

Other errors find my Error.cshtml, why doesn't 404 error find Error.cshtml?

I am tackling ASP.NET, MVC 3, web development, for the first time, all at the same time. Please bear with me, as I know this subject has been discussed heavily from different angles. I still have not ...
7
votes
1answer
346 views

A public action method 'cache' was not found on controller

I am getting A public action method 'cache' was not found on controller occasionally while executing the actionresult. Although here is no cache defined or used in my code.Don't know where from it is ...
7
votes
4answers
397 views

Localizing/translating routes in ASP.NET MVC

Anyone knows a nice solution to localize routes in ASP.NET MVC? What I'd like to achieve is that these two urls point to the same action/resource: http://example.org/Products/Categories (en) ...
6
votes
3answers
875 views

Infinite URL Parameters for ASP.NET MVC Route

I need an implementation where I can get infinite parameters on my ASP.NET Controller. It will be better if I give you an example : Let's assume that I will have following urls : ...
6
votes
1answer
5k views

Implementing “Remember Me” Feature in ASP.NET MVC

I'm trying to implement a "remember me" feature to my login form. I am using ASP.NET MVC as my web application. I managed to get the cookie stuff working, but I failed to automatically login the user ...
6
votes
2answers
193 views

ASP.NET MVC 3 routing: prevent ~/home access?

I'm fine with ~/ mapping to Home Index, and with ~/Blog mapping to Blog Index, but how do I prevent ~/Home mapping to Home Index as well? I don't want routes to be accessible from more than a single ...
6
votes
1answer
1k views

ASP.NET MVC 3 - Handling multiple domains and sharing a single code-base

I've been wondering about the best way to do this for a couple of days and wondered what everyone else thought. We want to rebuild and upgrade all our companies websites to ASP.NET MVC 3 and use a ...
6
votes
1answer
379 views

how may i add integer list to route

I'm trying to add int[] array to my Url.Action something like this: var routeData = new RouteValueDictionary(); for (int i = 0; i < Model.GroupsId.Length; i++) { routeData.Add("GroupsId[" + i ...
6
votes
2answers
215 views

MVC routes with special characters

I'm trying to support some legacy urls, and map them to controller actions. The URLs look like this: /~Home+Office~Note+Pads.html Here's my route: routes.MapRoute( "LegacyCategory", ...

1 2 3 4 5 33
15 30 50 per page