routing

Zend Framework - long routes(Router)

I'm already thinking about to start using simple GET string. Or I'm not so good at configuring routes? :) And configuring routes via regex in .htaccess foreach($links as $a) { $Router->addRoute($a['link'], new Zend_Controller_Router_Route( $a['link'] . '/:page/:ad_id/:photo/:price_from/:price_...

asp.net MVC route with nullable values - Updated 23/2 - UrlParameter.Optional

Hi, I've got the following route: routes.MapRoute( "Search", "Search.aspx/l-{lID}/t-{tID}/p-{pID}/s-{sID}", new { controller = "Search", action = "Search", lID = "", tID = "", pID = "", sID = "" }, new { lID = @"\d{0,}", tID = @"\d{0,}", pID = @"\d{0,}", sID = @"\d{0,}" } ); Which works fin...

ASP.NET MVC Route IDs with a period

If I have a route with the following {controller}/{action}/{id} and I look at the following URL c1/a1/abc. it doesn't work. This only happens when the period is at the end of the URL. Any way to get ASP.NET MVC to recognize that as part of the ID? ...

ASP.NET MVC and Routing Performance?

Are there any performance issues with registering a number of routes with the routing engine in ASP.NET MVC 2? What I am planning on doing is registered one route per page for content pages that are not categories. In other words, for pages like this there would be one route registered for each one: /Home/About /Home/Contact /Home/Dire...

Is it possible to route a Webmethod?

I have a .aspx page with some Webmethods that I use for jQuery ajax calls. [WebMethod] public static string HelloWorld(string s) { return "Hello"+ s; } And call this with Url: /ajax/Test.aspx/HelloWorld I wonder if it is possible to route this method to another url like /ajax/helloworld/? ...

Ambigous Routes Using ASP.Net MVC

So far I still have the standard routing. What I tried to do is public Foo : Controller { public ActionResult Index(int id) { return View("List", repo.GetForId(id)); } public ActionResult Index() { return View("List", repo.GetAll()); } } The URL I entered was localhost/Foo/Index. I was un...

Nested routes in Rails with an alias

I have a primary model for my project, Place.rb with a places_controller, and I've currently got it exactly the way I want for the users end of my project. With a nested photos controller, review, etc. I want now to create a management resource which is mostly just an alias for Places, with its own nested resources, some of them overla...

Routes - Tidily define multiple resources with customisation

Hi My routes are getting out of hand due to the fact that this isn't possible (correct me if I'm wrong): map.resources :english_pages, :as => :english, :spanish_pages, :as => :spanish do |article| Due to nested routes things are spiralling out of control (tidiness). map.resources :english_pages, :as => :english, :member => {:manage ...

ASP.NET System.Web.Routing and Querystring Parameters.

I am using ASP.Net 3.5 SP1 "System.Web.Routing" to enable URL routing in my WebForm Application. Now what i needed is to pass some parameters in QueryString eg: http://www.mydomain.com/Search/Books/Computers?sort=author&pagesize=10 This is the route i am using: routes.Add("BooksSearch", new Route ( "Sear...

Rails route for mapping records by name rather than id?

In my Rails application, I would like to route /product/productname1, /product/productname2, etc. to ProductController::index(). I don't want separate methods in my ProductController for each product name route. What would my route look like? I have map.connect 'products/:name', :controller => 'products', :action => 'index' But when...

Recursive routes in Rails

Is is possible to create a recursive route in Rails? I have an application, which allows a admin to create pages. The page model is a nested set and so each page has a parent_id hence the pages are structured in trees. The page model also uses the Friendly ID plugin to provide slugs for each page. When a user browses the site I would l...

Rails ActionController::MethodNotAllowed causes WSOD in production

I've got a RESTful resource (let's say posts) that excludes the index action. When I go to /posts, ActionController::MethodNotAllowed is raised because GET requests at that URL have been excluded. That much makes sense. The problem is that in the production environment, that URL just generates a white screen in the browser. I can see Ac...

Correct routing for a Rest API with Zend

Hi, I'm trying to implement a REST API to my website. My problem is that the default Zend routing gets in the way. I've first tried using Zend_Rest_Route but I haven't been able to understand how I was supposed to use it correctly for "deep" routes, aka website/api/resource1/filter/resource2/id. Using the default Zend routing, I'd need...

how can i do this with asp.net mvc routing ?

Is there a way to create a route like this "http://mysite/Username" ? ...

Accessing TCP/IP routing information from a .NET application

I need to check if a TCP/IP route already exists from my application and add the route if it doesn't. Now I'm running the route add <destination network ip address> MASK <mask> <gateway ip address> with a Process.Start() and that's fine for me. However, as I'm elevating the route command with a "runas" verb, I need to check first if ...

Get "Default" Route Url in Controller

Hi Guys Can anyone tell me what is the syntax for retreiving the actual URL for the "Default" Route? I'd like to do something like: string url = RouteTable.Routes["Default"].ToString(); //(even though that code is completely wrong) so that I could have the url value of the route available to work with. So far, I've been trying the...

Routing in ASP.NET MVC

Hi! I want to identify categories in my site in url not by id, but by its name. When i'm adding category, which name contains "+" symbol - i have 404 error. This situation is on product internet server, when i'm deploying on local visual studio server - all work fine. Please, suggest me smth. Example: routes.MapRoute( "Defaul...

Rails generate url from array with parameters

Hi I wondered if there's some way to do this polymorphic_path([@page, @image]) but like this polymorphic_path([@page, :image_id => 1]) It's for the purposed of refactoring where I'd like to throw various params into the array and where they're null, they're ignored, but otherwise they generate the relevant nested url. Thanks in ...

ASP.NET MVC : Ignore latter route elements in url for a form's action

Hi, I have a URL /products/search where Products is the controller and Search is the action. This url contains a search form whose action attribute is (and should always be) /products/search eg; <%using( Html.BeginForm( "search", "products", FormMethod.Post)) This works ok until I introduce paging in the search results. For example i...

How to specify a route member inside a block in Rails?

The following code: map.resources :users, :has_many => :items Could be written like this in a block: map.resources :users do |user| user.resources :items end How could I write the following code in a block? map.resources :users, :member => { :start => :post } Also, where could I find documentation on writing routes in blocks?...