routing

Can I store ASP.NET MVC routes in web.config?

筅森魡賤 提交于 2019-12-07 18:48:26
问题 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 than those added programmatically. I've done my searching, but the closest I can come up with is the RouteBuilder on Codeplex (http://www.codeplex.com/RouteBuilder), but this doesn't work with the RTM version of MVC. Does a solution out there exist compatible with the final 1.0? 回答1: I can't

ASP.NET MVC3 Routing - Same URL for different areas

时间秒杀一切 提交于 2019-12-07 18:41:29
My MVC3 project has an area called Mobile. Following is the behavior when going to my site from a desktop browser and mobile browser: Desktop browser: URL stays mydomain.com and the default desktop home page is correctly displayed. Mobile (iPhone) browsers: URL changes to mydomain.com/Mobile/Home and the mobile home page is correctly displayed. I would like the URL to stay mydomain.com regardless of whether it is being viewed from a desktop browser or a mobile browser. How do I accomplishing that? Try to use ActionName filter and custom action method selector for mobile device. Example (copy

Meteor's Iron Router - Route multiple paths to one template but still DRY

本秂侑毒 提交于 2019-12-07 18:41:25
问题 I want to route multiple paths to the same template. For example, /abc/home and /home will both show the home template. The paths can also have subpaths, so abc/parent/child and /parent/child should route to same path also. I can simply repeat : Router.route('/home', function () { this.render('home'); Session.set('menu', 'home'); }); Router.route('/abc/home', function () { this.render('home'); Session.set('menu', 'home'); }); But I don't want to repeat it. If I want to change the template to

Ionic 3 - add a 404 page to URL Router

你说的曾经没有我的故事 提交于 2019-12-07 18:18:28
In this Question I found a answer for 404 pages in Ionic 3 Routing: Custom 404 page Ionic 3 But I have a problem in my router when I use parameters. If I add this to my router: { component: EventdetailsPage, name: 'Details', segment: 'event/:eventId',defaultHistory: [HomePage] }, With this line at the bottom of my config, every call to a page with parameters will redirected: { component: NotFoundPage, name: "*", segment: ":**", defaultHistory: [NotFoundPage] }, on every call of .../event/123 it will redirect me to the 404 page. I tried a lot of combinations like -> segment: ": "/": " but

ASP.NET Routing - load routes from database?

丶灬走出姿态 提交于 2019-12-07 18:06:59
问题 Is it possible to load routes from the database with ASP.NET ? For each r as SomeRouteObject in RouteDataTable routes.MapRoute( _ r.Name, _ r.RouteUri, _ r.RouteValues, _ //?? r.Constraints _ //?? ) Next How should I store the routevalues / constraints? I understand that there are several ' default ' routevalues like .Controller and .Action , however I also need entirely custom ones like .Id or .Page ... 回答1: Think before you jump It is possible but is not feasible. They've provided route

ASP.NET MVC - Rewriting FormMethod.Get querystring?

大兔子大兔子 提交于 2019-12-07 16:53:35
问题 I have a simple form with just one textbox and one submit button. The form basically sends to a different page with the value in the textbox as querystring. When I click on the submit button, the querystring is in this format, for example: mysite.com/?TargetCode=Test1 I would like it to display in this format: mysite.com/Test1 I already have an Action in my HomeController that take the "TargetCode" as the querystring, and I've already setup a routing in the Global.ascx.cs for that. What

Angular2 Can't resolve all parameters for RouterOutlet: (RouterOutletMap, ViewContainerRef, ?, name)

微笑、不失礼 提交于 2019-12-07 13:42:10
问题 I'm totally new to any JS framework. Just started learning Angular 2. I'm doing some basic app for internship. From angular app I post name to Java controller, that get's info needed and sends it back. Basically fun happens when name is 'Dave' or 'Hal'. All looks fine, but when I run server and try to get to my app, I get EXCEPTION: Error: Uncaught (in promise): Can't resolve all parameters for RouterOutlet: (RouterOutletMap, ViewContainerRef, ?, name). As far as I can tell from documentation

How to access Java servlet running on my PC from outside?

不打扰是莪最后的温柔 提交于 2019-12-07 13:18:39
问题 I used Netbeans6.7 to write a servlet, when it runs, it opens a browser window with this address : http://localhost:8080/My_App/Test_Servlet, I replaced the "localhost" with my IP address, now it looks like this : http://192.???.1.??:8080/My_App/Test_Servlet, but I tried to access it from another computer outside my home, it can't read anything, I wonder if I need to change Windows Fire Wall setting to allow outside traffic, it's a Paypal IPN app, so I call Paypal, they said they can't access

Modified Dijkstra to find most optimized shortest path given extra properties

微笑、不失礼 提交于 2019-12-07 12:44:34
问题 This is a follow-up question for a question I asked at here. The problem is mapped to a graph with say non-negative weights on edges (no preference if it can be directed or not). However, along with a weight which is actually distance, we also have another property which is data coverage of the edge which can be important factor which route to select given how severe I need internet on my phone (for real-time gaming for example I need good bandwidth). So overall, we want to somehow find a

a variation of TSP : limit time, visit as many nodes as possible

試著忘記壹切 提交于 2019-12-07 12:19:45
问题 again let's use the salesman context: if the salesman is not required to visit ALL customers, but is given a time constraint, in which he must vist as many customers as possible. how can we find the best route? an even more slightly advanced version is, say each customer is marked with a monetary gain, so our salesman wants to maximize the total monetary gain from those customers that he actually visits, as long as he finishes visiting them within the time constraint I tried to search for