url-routing

Optional URL parameters with url routing in webforms

Playing with the new(ish) url rewriting functionality for web forms, but I'm running into trouble trying to declare parameters as optional. Here's the scenario. I've got a search function which accepts two parameters, sku and name. Ideally I'd like the URL for this search function to be /products/search/skuSearchString/nameSearchString....

URL routing, rewrite path but keep mimetype

I have implemented my own IRouteHandler for URL routing. For files without extension it will try to load the filename as a Page from the Pages directory with: return (IHttpHandler) BuildManager.CreateInstanceFromVirtualPath(path, typeof(Page)); However there are also images and css files (with relative paths) that need to be translate...

ASP.NET MVC url search parameter without question mark

I have a route defined as: routes.MapRoute("AllUsers", "Users/Search/{Search}", new { Controller = "Users", action= "Index"}); and the form as: <% using (Html.BeginForm("Index", "Users/Search/", new { RouteValue = "AllUsers" }, FormMethod.Get, new { id = "searchForm" })){%> <input id="searchBox" name="search" type="text...

URL Routing parameter name, order

Asking for the best way to address this issue: in my controller I have the following action public ActionResult Member(string id){return View();} another action in the same controller public ActionResult Archive(string year){return View();} in my global.asax routes.MapRoute( "Archive", ...

Why am I getting duplicate exception entries using ELMAH in ASP.NET MVC?

I'm brand new to ELMAH but I've been working with MVC for a little while now. After reading several blogs on the subject I'm pursuing the road of having an ErrorController that handles 404 and unknown-error pages, and making a default route that forwards all unknown paths to the 404 action on that controller. The problem is that ELMAH ...

Ruby open-uri, returns error when opening a png URL

I am making a crawler parsing images on the Gantz manga at http://manga.bleachexile.com/gantz-chapter-1.html and on. I had success until my crawler tried to open a image (on chapt 273): bad URI(is not URI?): http://static.bleachexile.com/manga/gantz/273/Gantz[0273]_p001[Whatever-Illuminati].png BUT this url is valid I guess, because I...

URL Routing and QueryStrings in ASP.NET Web Forms application

I am trying to implement URL Routing for a non MVC application. Here's my original URL: http://mydomain.com/ProcessStuff.aspx?id=1029019 to http://mydomain.com/Process-This-Stuff/1029019 I have difficulty when the page has query strings in the URL. This is the route handler I have so far: public class CustomRouteHandler : IRoute...

Monorail parse URL to routing values

Is it possible to fire up nvelocity routing mechanism outside the context of request (standalone app, or a testing framework) and get an url from action and routing values from url? Here is a test, i need to figure out the routingMethod: var url = routingMethod.ResolveAction<MyController>(c=>c.MyAction("Foo",1)) Assert.AreEqual("/MyCon...

Url Routing Asp.net from hierarchical tree of pages stored in a database

Ok I have a bunch of html pages stored in a mssql database. Each row has: ID PageTitle Page Html Content ParentId ParentId is there so i can create a hierarchical tree of pages. Currently i am using this line of code in order to access the pages... routes.MapPageRoute("front", "{PageTitle}", "~/front.aspx"); Which then causes a ...

three20 - can the query added to an openURLAction also be passed back to the parent

I am setting up routing to a TTTableViewController as follows: [map from:@"myurl://filter/(initWithName:)" toViewController:[FilterViewController class]]; and then, in another view controller I set up a mutable dictionary to pass through as my query: // Set up dictionary and populate a field NSMutableDictionary *filterDictiona...

Is it safe to depend on a trailing slash in a URL for routing purposes?

I'm building a site that has products, each of which belongs to one or more categories, which can be nested within parent categories. I'd like to have SEO-friendly URLs, which look like this: mysite.com/category/ mysite.com/category/product mysite.com/category/sub-category/ mysite.com/category/sub-category/product My question is: Is...

Override default route but call it when necessary

I'm developing a site which has urls like this: site.com/james site.com/james/photos Schema for this urls are this: site.com/USERNAME/APPLICATION Both username and application names are checking from db yb program logic. I set the route for this but Zend is routing all requests to this route. But there is same controllers and admin ...

Zend Framework : Subdirectories in controllers directory

Hi all, I'm using the Zend Framework for my website, and just created a special module "api" to create... Well, an API. Now, I have a lot of controllers in my module and I'd like to create subdirectories in this controllers directory in order to "tidy" it. My new structure would be something like this : - controllers/ - controllers...

Routing *Path wildcard will not accept Path when only one slash

I have a problem with the wildcard route that I wonder if anyone can help on, I have a route as below routes.MapRoute( "ReportRoute", "Report/{*path}", new { controller = "Home", action = "Index"}) .RouteHandler = new ReportPathRouteHandler(); where the routehandler splits the path int...

SEO URL Structure

Based on the following example URL structure: mysite.com/mypage.aspx?a=red&b=green&c=blue Pages in the application use ASP.net user controls and some of these controls build a query string. To prevent duplicate keys being created e.g. &pid=12&pid=10, I am researching methods of rewriting the URL: a) mysite.com/mypage.aspx/red/green/...

How can I make a url like /united-states/cities/new-york

How can I make a url like "/united-states/cities/new-york" intead of "/countries/1/cities/1" (I dont't want the word "countries" in the url) what do I have to write in route.rb to use: site.com/united-states/cities/ (to see united states' cities list) site.com/united-states/cities/new-york/ (to see new york details) and how use these...

How to configure a URL with 3 levels in ASP.NET MVC?

Using ASP.NET MVC, I need to configure my URLs like this: www.foo.com/company : render View Company www.foo.com/company/about : render View Company www.foo.com/company/about/mission : render View Mission If "company" is my controller and "about" is my action, what should be "mission"? For every "folder" (company, about and mission) ...

how can i rewrite secured url in asp.net

hi experts, please look at below specified url http://10.130.18.212/Test/(S(klcclla5uwjxijryxfvm3muj))/Quality/secureWelcome.aspx i found this kind of secured url in various various web sites. please let me know how can i embed "(S(klcclla5uwjxijryxfvm3muj))" within the url. please let me know in detailed. to which concept it does be...

How do you link to an action that takes an array as a parameter (RedirectToAction and/or ActionLink)?

I have an action defined like so: public ActionResult Foo(int[] bar) { ... } Url's like this will work as expected: .../Controller/Foo?bar=1&bar=3&bar=5 I have another action that does some work and then redirects to the Foo action above for some computed values of bar. Is there a simple way of specifying the route values with Red...

Re-authentication required for registered-path links (to ASP.NET site) coming to IE from PowerPoint

We're using URL routing based on Phil Haack's example, with config modifications based on MSDN Library article #CC668202, to provide "shareable" links for a ASP.NET forms site, and have run into a strange issue: For users attempting to open links from PowerPoint presentations, and who have IE set as their default browser, using one of th...