Questions tagged [routes]
Questions about mapping URLs to Controllers and Actions.
routes
33,485
questions
3
votes
3
answers
2k
views
ASP.NET MVC Routing construct links based on current url
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("...
11
votes
3
answers
9k
views
Shorten Zend Framework Route Definitions
How can I shorten the definition of my custom routes in Zend Framework? I currently have this as definition:
$route = new Zend_Controller_Router_Route(
":module/:id",
array(
"...
3
votes
1
answer
716
views
ASP.NET MVC: Form Input to pretty URLs
I have a URL:
Shipment/Search/{searchType}/{searchValue}
and a controller action:
// ShipmentSearchType is an enum ... PartNumber, CustomerOrder, etc...
ActionResult Search(ShipmentSearchType ...
1
vote
3
answers
214
views
RoR: how do I create a "valid signup code" lookup?
I want to be able to give codes to potential users in the form of email links (e.g. mysite.com/signup?beta=rapunzel)
When someone clicks on the link, it populates a hidden_field with the value (will ...
0
votes
1
answer
865
views
Rails: Database records with custom route...?
I have a model, target, that holds a number of records that are timestamped. On the corresponding controller, I list the months of those records by doing the following:
In models/target.rb
def ...
1
vote
2
answers
491
views
How do I make this ASP.NET MVC Route for a twitter-style URL work?
trying to map the following style of route: http://site.com/username in the same way that you can do http://www.twitter.com/user
My initial solution was to have these routes:
//site.com/rathboma - ...
0
votes
2
answers
214
views
MVC w/ JavaScript - trips route
See the exception
I have a JS include in my master page and it seems to be tripping one of the routes every time.
Is tripping this route:
routes.MapRoute(
"CatalogType",
"Catalog/{group}/{type}/{...
0
votes
1
answer
776
views
asp.net routing with web forms--all routs get a 404
I have created a web forms app that implements routing. My applications utilizes Phil Haack's example (http://haacked.com/archive/2008/03/11/using-routing-with-webforms.aspx). All of my routes ...
2
votes
2
answers
4k
views
Can I store ASP.NET MVC routes in web.config?
I'm looking for a method of storing routing information in my web.config file in addition to the Global.asax class. The routes stored in the configuration file would need to take higher precedence ...
3
votes
1
answer
570
views
Strange Rails Routing behaviour: two ids swapped around in nested resources
I have the following routing set up in my app (forms belong to a site):
map.resources :sites do |site|
site.resources :forms
end
However, when I try to go to a path for edit (or such) for a form ...
3
votes
1
answer
3k
views
Giving a nested route an alias in Rails
If I want to provide an alias for a controller, I can use map.resources :rants, :controller => 'blog_posts' yoursite.com/rants points to the blog_posts controller fine.
How do I give an alias to a ...
0
votes
3
answers
720
views
C# asp.net mvc 1.0 routing
In my web app. i want to setup a route like this:
/document/quality/index
/document/general/index
/document/quality/detail/[id]
/document/general/detail/[id]
As you can see i have two kind of ...
0
votes
1
answer
498
views
How can I implement Dynamic Routing with my choice of URL format?
My URL requirement is countryname/statename/cityname. For this I'm writing my own RouteHandler and adding one new route into the routecollection like this:
routes.Add(new Route("{*data}",
...
2
votes
3
answers
827
views
Dynamically construct RESTful route using Rails
I'm trying to write a helper method that accepts the name of a plural resource and returns a corresponding link. The essence of the method is:
def get_link(resource)
link_to "#{resource.capitalize}"...
0
votes
1
answer
350
views
ProcessRequest(HttpContextBase) method
How to change the default Action name inside the ProcessRequest(HttpContextBase) method..