I have urls that look like this
~\articles\energy\topweek
~\articles\metals\latestpopular
where second url string is a category and third is a filter
so route looks like this
routes.MapRoute("ArticleFilter",
"articles/{category}/{filter}",
new { controller="Article", action="Filter" })
That's pretty easy and everything ...
Hi guys,
is there a way to send multiple parameters to controller as one parameter?
for example, if I have route:
{controller}/{action}/{languages}
can parameter languages be array of strings?
if it does, how to use it...how to send array to controller and how to parse it in controller method?
thanks
Marko
...
From within a Controller's action, how can I get the current route information?
How can I loop through the other routes?
...
Hi,
i have a webapp which works perfectly when debugged and tested locally. However when I publish the site to a productionserver the routing is messed up. This is because it runs as a sub-project on the productionserver.
Testing: http://localhost:xxx/
Production: http://remotehost/webapp/
How should I setup routing?
This is m...
I define a lot of explicit routes. One of them is:
routes.MapRoute("default", "",
new { controller = "Home", action = "Index" });
At the end, I define a catchall route:
routes.MapRoute("PageNotFound", "{*url}",
new { controller = "Error", action = "Http404" });
If I go to the homepage http://localhost, then the http404 page is ...
Hi,
I read this article about how you can prefix routes in ruby on rails. I want to be able to do the same thing with asp.net mvc
So I want to be able to define a route like :
/photographers/1/photos/2 //photo 2 of photographer with id 1
/photographers/1/photos //all of photographer with id 1
Any tips ?
EDIT:
"photographers/...
Hi there.
I currently have this route defined (among others):
"{controller}/{action}/{id}/{designation}" being:
"id" my primary key
"designation" only used for SEO and not taken into account.
now my problem is:
"http://server/Home/Index/1/teste" works but "http://server/Home/Index/1/teste " with a space in the end doesn't.
IIS is g...
I am having trouble getting routing to work on mono. The default route works fine but nothing else does.
These are the routes I have setup:
routes.MapRoute(
"HelloRoute",
"Hello/{name}",
new { controller = "Home", action = "Hello" }
);
routes.MapRoute(
"Default",
...
Lets suppose that I have some pages
some.web/articles/details/5
some.web/users/info/bob
some.web/foo/bar/7
that can call a common utility controller like
locale/change/es
or
authorization/login
How do I get these methods (change, login) to redirect to the previous actions (details, info, bar) while passing the previous parameters...
My unfamiliarity with the ASP.NET MVC framework and the plumbing thereof has brought me here, and I appreciate the patience it will take for anyone to read and consider my question!
Okay, here is the scenario: I have an application that has numerous pages with grids that display data based on searches, drilling down from other data, rep...
I'm currently creating an admin tool for a new project which I would like to use to retrieve a url from a different project in my solution.
Although the product controller doesn't exist in the project I am calling it from, I would like to retrieve it from the first project.
Is this at all possible, or would I need to create some sort o...
I have a series of URLs that look like
/Catalog/Ajax/Update/{ViewToUpdate}?var1=a&var2=b&var3=c
Currently I've setup several routes - one for each {ViewToUpdate} and what I'd like to do is pass the {ViewToUpdate} to my Action handler so I can condense my code. Instead of:
public ActionResult AjaxUpdateNavigation(string var1, string...
I'm using the new routing functionality in ASP.NET 3.5 to act as my catch-all for page requests to my website. I've registered my route as follows within the global.asax,
<%@ Application Language="C#" %>
<%@ Import Namespace="System.Web.Routing" %>
<script runat="server">
void Application_Start(object sender, EventArgs e)
{
...
When i'm starting the server with the path option
script/server --path=/myapp
while having a route
map.route 'foo', :controller => 'bar', :action => 'buzz'
then
ActionController::Routing::Routes.recognize_path('/myapp/foo')
raises an error "No route matched ..."
Question: How can i make Rails built-in routing recognize with p...
I'm loading a special set of routes form an XML file.
Those rotes must be created in my application for compatibility reason with the previous version of my application.
Initially, the first version where wrote in .net 1.1, and I must create some routes to fully support "old" urls to the new ones.
The application has been full rewrited ...
Most of the actions in my controller have statically-defined parameter lists and so they correspond nicely with the standard tutorial examples:
public ActionResult SomeAction(string id, string arg1, string arg2)
{
// use arg1, arg2...
}
But I have one troublesome case where the view puts together a form dynamically, so the set of ...
A Facebook app is hosted on my server at, say, http://server.com/projects/fbapp/, but is only ever viewed in Facebook at, for instance, http://apps.facebook.com/fbapp/.
Using CakePHP this presents a problem - should routes be prefixed with "/project/fbapp" or just "fbapp"?
It's a problem because routes are used not just for routing inb...
I need to change the way MVC is rendering action links(and form's and url's, etc) based on a configuration setting. I am writing a facebook application using MS MVC and my action links need to render link so:
<a href="/MyFBApplication/Home/Index/">home</a>
clicking the above link would browse to:
http://apps.facebook.com/MyFBApplicati...
How can I get the actual "Main-Controller" in a RenderAction?
Example:
MyRoute:
{controller}/{action}
My url my be:
pages/someaction
tours/someaction
...
In my Site.Master I make a RenderAction:
<% Html.RenderAction("Index", "BreadCrumb"); %>
My BreadCrumbController Action looks like this:
public ActionResult Index(string cont...
how do you make it so that www.site.com/123 or www.site.com/123/some-headline www.site.com/123/anything-at-all will lead users to the same place which is www.site.com/123 ? I think the routing in Ruby on Rails can do it. But other than that, what other methods can do that. can it be done by Apache alone?
...