routing

ASP.NET MVC Routing for a Single Controller Site

こ雲淡風輕ζ 提交于 2019-12-06 05:11:57
问题 I'm trying to create a simple site. Basically it has one Controller Home controller. This controller has an action Index takes a string as argument (which is a directory) and uses that 'directory' to do its work. I can't work out how to create a generic catch all route that will send every URL to this one Action. Any URL combination could exist, and anything beyond the domain name should be the string. http://<domain>/2008 http://<domain>/2008/09 http://<domain>/2008/09/Fred Does anyone know

Zend URL Parameter - Hide Key and Show Value

限于喜欢 提交于 2019-12-06 05:02:58
问题 using Zend's default routing a URL looks like: www.domain.com/controller/action/key1/value1/key2/value2/key3/value3 Each Key and Value are stored as a pair in the array returned by getParams(); In this example: array("key1" => "value1", "key2" => "value2", "key3" => "value3") I want the parameter URLs to look like: www.domain.com/controller/action/value1/value2/value3 The parameters should be mapped in an array like this. The key should depend just on the value's position in the URL. array(0

How to get a trailing slash appended to page routes?

拟墨画扇 提交于 2019-12-06 05:01:00
This is a near identical problem I am having to that of this query, albeit mine is a Web Forms scenario (using routing in .NET 4) as opposed to MVC. Add a trailing slash at the end of each url? The solution that someone mentions there is only half provided unfortunately as the link to the complete solution is broken. At the moment, any trailing slash from my page routes is removed when I get the route url. This is especially problematic when I want to use the following type of inline syntax on my web form: <a runat="server" href='<%$RouteUrl:RouteName=Posts %>'> Again here the trailing slash

Rails 3 Routing Resources with Variable Namespace

六月ゝ 毕业季﹏ 提交于 2019-12-06 04:43:58
Is it possible to have a variable namespace? I have restful resources like the following: resources :articles resources :persons But I need to scope these inside a variable namespace, such that it responds to URLs of the form: ':edition/:controller/:action/:id' for example: /foobar/article/edit/123 or /bazbam/person/edit/345 for each of the resources. Is this possible with the resources method, or must I hand-craft these? I will not know the possible values for :edition ahead of time; these get looked up in a before_filter in my ApplicationController . Is this all I need to do? scope ':edition

How to deploy Angular 2 application as a standalone (using dist folder)

旧城冷巷雨未停 提交于 2019-12-06 04:17:46
I have finished a development of Angular 2 application and I need to deploy it. I need it to work standalone. So, I tried to move the content of dist folder inside a new apache website, but the routing mechanism doesn't work for some reason, I am getting 404 error when I try to go to /integrations route, for example. During the development, on angular 2 server, /integrations works and Angular 2 routing mechanism works and displays the component without problem. I need the standalone app to also be able to work with different URLs/paths. Any suggestions? Follow following steps : Step 1 : ng

Combres.axd returns 404 in WebForms app

不打扰是莪最后的温柔 提交于 2019-12-06 03:29:13
问题 I have 2 ASP.NET apps, 1 WebForms and 1 MVC. Combres worked beautifully for both while working locally on IIS Express. After deploying both apps to the test server (IIS 7, both apps are in the same web site in IIS) the combres.axd link referenced in the pages of the WebForms app is returning a 404, while the MVC app works fine. I hooked up the the WebForms app to my local IIS as well and it again worked fine. I looked at the modules and handlers between my local IIS, the MVC app and the

Why won't this route match

邮差的信 提交于 2019-12-06 03:13:30
问题 I'm having some trouble getting routes to match. I am using base-32 encoded int's as short links to slideshows in a web app. There are 5 different versions of each slideshow, and I am using an initial letter to distinguish between each version. The routes always match, except when the first character of the base-32 encoded int is the same as the character designating the slideshow version. This anomaly exists for all 5 prefix letters: n, f, c, x, and h. What about the first two characters

Sitecore, custom MVC controllers and routes

北战南征 提交于 2019-12-06 02:48:01
I have a website defined in Sitecore's site definitions. The path to it is /localhost/mysite/home . And it works. I need to create a custom controller to submit forms with an API bypassing Sitecore. So I have FormsController (inheriting from MVC controller) with an action named "Test" taking no parameters. I defined the route in the initialize pipeline like this: public class Initialize { public void Process(PipelineArgs args) { MapRoutes(); GlassMapperSc.Start(); } private void MapRoutes() { RouteTable.Routes.MapRoute( "Forms.Test", "forms/test", new { controller = "FormsController", action =

Routing in ASP.NET MVC 2.0

感情迁移 提交于 2019-12-06 02:18:45
I'm looking to make a really simple route in my ASP.NET MVC 2.0 website. I've been googling for help but all the examples I can find are for really complex routing. Basically I want all the pages in my Home Controller to resolve after the domain as opposed to /Home/ For example I want http://www.MyWebsite.com/Home/LandingPage/ To become http://www.MyWebsite.com/LandingPage/ But only for the Home controller, I want the rest of my controllers to function as normal. I thought about creating a controller for each and just using an index, but we need lots of landing pages for our marketing like

Android - Google Maps routing

天涯浪子 提交于 2019-12-06 02:03:49
问题 I have added Google maps functionality into my application a now I am asking you, is there any way, how can I add o this mapView routing fnctionality. I will have my coordinates from my GPS (like start) and coordinates of my destination. I would like to draw route, which I should take to reach the finish. Is it possible? Thanks 回答1: Hmyzak see the most promising solution given by Max Gontar...It worked for me. J2ME/Android/BlackBerry - driving directions, route between two locations Full