routing

Controller/Routing Errors with js, img files using a CommonServiceLocator ControllerFactory

I've set up an ASP.NET MVC RC2 application to use a custom controller factory backed by a CommonServiceLocator (using StructureMap). Routing to and instantiating controllers works fine, but for some reason I'm getting exceptions when trying to access .js, .jpg, or any other static file. Here's the ControllerFactory code: public class ...

routing to blank request in mvc asp.net using IIS 6.0

I'm attempting to connect to my published website using the following url. http://www.mywebsite.com/ I keep getting: The incoming request does not match any route. Here are my routing rules: routes.MapRoute( "Default", // Route name "{controller}.aspx/{action}/...

ASP.Net MVC Routing and the PreRequestHandler

I'm trying to instantiate a service and authenticate the current user within the Application_PreRequestHandlerExecute() method and then dispose of this service in the* Application_PostRequestHandlerExecute() method of the global.asax.cs class. One of the items I need for this process is the orgname which is appended at the beginning of ...

Can I make ASP.NET MVC Html.RouteLink() return a url for my home page without an ID?

I've got a single route in my Global.asax.vb page like this... Shared Sub RegisterRoutes(ByVal routes As RouteCollection) routes.IgnoreRoute("{resource}.axd/{*pathInfo}") routes.MapRoute( _ "IdOnly", _ "{id}", _ New With {.controller = "Page", _ .action = "Details", _ ...

asp.net mvc localization

I'm trying to implement localization with routes I have the following: routes.MapRoute( "DefaultLocalized", "{lang}/{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = "", lang = "en" } ); r...

How do I set up a universal controller in ASP.NET MVC?

I know it's not perhaps in the true spirit of MVC, but I just want to have a single global controller that always gets called no matter what the url looks like. For example, it could be: http://myserver.com/anything/at/all/here.fun?happy=yes&sad=no#yippie ...and I want that to be passed to my single controller. I intend to obtain t...

How to check what URL a RedirectToRouteResult will make?

In my asp.net-mvc project I do a redirect from a post request to a get request. In between my redirect and my arrival of the method I expect it to arrive, one of my parameters magically turns into null and I can't figure out why. Probably it has something to do with my global.asax (route defenition). The only way I can come up with to d...

ASP .NET MVC default routing problem RTW 1.0

I have just installed the RTW 1.0 of the MVC framework. I was using RC2 in the past to go through the tutorials. I now have a problem where basic routing doesn't work which i didn't have in RC2. If i create a new MVC application in VS 2008 the routings for the home page don't work out of the box. The following URL's work for some reaso...

How to use IRouteHandler to invoke a WCF REST service

Has anybody managed to make an IRouteHandler to invoke a WCF REST Service. I can't find the appropriate IHttpHandler to return in the IRouteHandler implementation. I want to try routing as opposed to url-rewriting to see if I can get the required RESTful URIs in cassini as well as IIS6+. Thanks, Steve ...

Rails: get to parent resource

I got a config/routes.rb file like this: map.resources :categories, :shallow => true do |cat| cat.resources :entries, :member => {:yes => :post, :no => :post } end My goal is use yes and no as buttons that modify my entries (it is like a game, and yes and no are answers to the entries). I would like that when I click on yes...

Page not found by ZendRouter: treats folder name as controller name

I've tried to run ZF Quickstart app not from the root folder, but from webserver subfolder, like a usual php app, e.g. localhost/quickstart. When localhost/quickstart/guestbook gives page not found error: > Page not found > > array(3) { ["controller"]=> > string(10) "quickstart" ["action"]=> > string(9) "guestbook" ["module"]=>...

Html.ActionLink for non-standard routing

I have a route definition like this: routes.MapRoute( "Pagesize", "{controller}/{action}/pagesize/{pagesize}", new { controller = "Home", action = "Index", pagesize = 10 } ); When I use <%= Html.ActionLink("MyText", "myaction", new { pagesize = 10 }) %> it renders as <a href="/myaction/?pagesize=10">MyText</a> I can...

Is it possible to read a querystring in ASP.NET-MVC when hitting /mysite?q=123

I have a site that external sites are linking to with a campaign ID http://www.example.com?cid=123 or (with a slash) http://www.example.com/?cid=123 In the case where you miss off the slash most browsers will go and add it in for you. So in either case, whichever you enter the URL that my application is hit is the seco...

Rails: Nested namespaced resource route

map.resources :users map.namespace :formulator do |formulator| formulator.resources :submissions end I want to have submissions be a nested resource of users, but I'm not sure how to since it's namespaced. ...

How do you insert a named route into the RouteCollection object?

I exclusively use named routes (as a best practice) when using ASP.NET Routing. The RouteCollection object has an Add function that allows you to easily add a named route to the collection. However, if you need to insert a named route (due to routing order) the Insert function does not have a name parameter and therefore it doesn't see...

Low case urls in ASP.NET mvc.

Hi. Is it possible to force/extend routing engine generate urls in lower case, "/controller/action", instead of "/Controller/Action"? ...

Mongrel Rails error: RoutingError (No route matches "/://0" with {:method=>:get}):

Hi, I keep seeing this error in my rails production log, any ideas what the issue is? Im running rails on apache with mongrel clusters. RoutingError (No route matches "/://0" with {:method=>:get}): Not sure what attempted url is causing the error. Edit: Heres my routes.rb file ActionController::Routing::Routes.draw do |map| map.sign...

(network sockets) bytes stuck in Send Queue for 15 minutes; why?

I have a Java program running on Windows (a Citrix machine), that dispatches a request to Java application servers on Linux; this dispatching mechanism is all custom. The Windows Java program (let's call it W) opens a listen socket to a port given by the OS, say 1234 to receive results. Then it invokes a "dispatch" service on the serve...

dual wan public ip for server

Currently have a dual wan setup both connections with the same ISP who has provided me 8x2 public IP's. I would like to create redundancy so my ms sbs server and IP PBX (trixbox) have public IP's and will continue to work even if either wan connection goes down. for since the sbs server is a domain controller, it needs an internal IP ad...

Ho do I change the base path of routes in CakePHP?

I'm using CakePHP to produce a Facebook application (though the problem is not Facebook specific). As usual, I'm struggling to get the reverse routing to work properly. Previously I've abandoned the routing functionality, but this time I'd really like to make it work. The problem is basically that Cake produces URLs relative to the base...