I am using .NET MVC 2 with Windows XP (IIS 5.1). I have set up wildcards per this blog.
The problem I run into is sometimes when I call some of my actions, they are returning 404 errors. Here's how I'm calling them (using a button):
<% using (Html.BeginForm("MyController", "MyAction")){ %>
<input type="submit" value...
In my AccountController class I have the following:
public ActionResult Verification(string userGuid)
{
Debug.WriteLine(userGuid);
...
In my global.asax I have:
routes.MapRoute(
"AccountVerification",
"{controller}/{action}/{userGuid}",
new { controller = "Account", action = "Verification", userGuid = UrlParameter....
I have a route defined last in my ASP.Net MVC 2 app that will map old urls that are no longer used to the appropriate new urls to be redirected to. This route returns the action and controller that is responsible for actually performing the redirect and it also returns a url to the controller action which is the url to redirect to. Since...
How do I make my application route to mydomainname/username/controller.
I am working on asp.net mvc web application that enables a user to belong to multiple account. ie. In the application every account has its own users, and each user in one account can also be a user in another account. What i need is when a user wants to login, the...
I'm working on a site that is partially static content and partially MVC. The root of the site is index.html and I have all of the controllers explicitly routed and all html files ignored. However, when you hit the root of the website, it tries to route it. How can I tell the route engine to ignore the root of the site? www.mysite.com...
Unfortunately I need to accept a route parameter with an & in it. I have this route definition. The id parameter will sometimes have an & in it like this X&Y001.
routes.MapRoute(
"AffiliateEdit",
"Admin/EditAffiliate/{*id}",
new { controller = "UserAdministration", action = "EditAffiliate", i...
I'm trying to create a route that looks like this
site.com/controller/{Param1}/{dbID}-{friendly-name}
and omit the default action index , and for the action edit to be at the end of the url like so
site.com/controller/{Param1}/{dbID}-{friendly-name}/edit
routes are a bit confusing for me , so any help is appreciated ,
Than...
I have a funny problem I haven't been able to track down. On my development machine at work I'll have something like:
$.getJSON('Action', ...
However when I'm at home, I'll need to use this to get it to work:
$.getJSON('Controller/Action',
Nothing else changes and everything runs fine except for this. Both machines are pretty muc...
I'd like to create a site where each user has his own home page and where the URL is in the format site\username. How can I accomplish this with ASP.NET MVC routing system?
I'm planning the follow URL layout:
mysite/ -> home page
mysite/account/register -> account register page
mysite/user1 -> user1 home page
mysite/user2 -> u...
I have an asp.net mvc 2 app (using .net 4.0) that isn't routing correctly when hosted in a virtual directory. I have the following simple routing rule:
routes.MapRoute(
"Default", // Route name
"{action}", // URL with parameters
new { controller = "accounts" } // Parameter defaults
);
...
In Asp.net MVC the url structure goes like
http://mysite.com/{controller}/{action}/{id}
For each "controller", say http://mysite.com/blog, there is a BlogController.
But my {controller} portion of the url is not decided pre-hand, but it is dynamically determined at run time, how do I create a "dynamic controller" that maps anything t...
Am pulling my hair out over this!
I have an ASP.NET MVC 2 web application, which up until yesterday was working fine on the hosted server (running IIS 7.5, I don't have direct access to IIS, just web portal access to some features).
Yesterday I attempted to install the ELMAH logging framework (see this article) and now all my routes ap...
Folks:
My ASP.NET MVC 1.0 application is more like a workflow.
Means: Parent controller's action method (authentication) --> Child 1 Action method --> Child 2 Action method --> Child n Action
Now once the visitor completes the Authentication through the parent controller's action method he can manupulate the URL and jump directly to t...
Hello,
I have an ASP.NET MVC app with the following deployment requirements:
The URL structure must be something like:
http://server/app/[enterprise]/[communinty]/{controller}/{action}/...
What I think I want to be able to do is intercept the URL before the MVC route handler gets its hands on it, remove the [enterprise]/[community] p...
Hi there
I am trying to build a route with the format of
{controller}{action}{classificationID}{reviewID}{CategoryID}\
but I want to be able to address it without the final CategoryID and have that default to 1 where it isn't given.
Here are my routes:
routes.MapRoute(
"Default", // Route name
"{contr...
I'm working on migrating an existing ASP.NET web site into an MVC project. There are several (60+) pages that I don't want to rewrite just yet, and so I'm wondering if there's a way that I can:
Move the existing .aspx pages (both markup and code-behind files) into a 'Legacy' folder in my MVC structure
Set up routing so a call to /foo....
Hey guys,
I will try and be brief, I am finding when trying to create a custom route with a name and url of properties that my ASP.NET MVC app is returning a 404 file not found when hitting the route.
I have deduced this down to most likely be caused by the fact I have a folder on disk called Properties which is of course a common asp....
I am working with ASP.NET MVC 2 and would like to optimize my routing. The desired result is as follows:
http://www.url.com/Sites/
http://www.url.com/Sites/Search/NY001
http://www.url.com/Sites/NY001
http://www.url.com/Sites/NY001/Photos
The problem with this scenario is that I want to treat the URL bits differently depending on their...
I was having trouble debugging why a route was throwing a 404 when I was positive I set it up correctly. I made changes, rebuilt, still 404, I did all kinds of crazy stuff to the route but always 404.
then in my frustration I just deleted ALL the routing in global.asax, saved rebuilt and ran. I still got 404...
but the rest of the site...
I am workingon an MVC route that will take an unknown number of parameters on the end of the URL. Something like this:
domain.com/category/keyword1/keyword2/.../keywordN
Those keywords are values for filters we have to match.
The only approach I can think of so far is UGLY... just make an ActionResult that has more parameters than I ...