url-routing

ASP.Net: HTTP 400 Bad Request error when trying to process http://localhost:5957/http://yahoo.com

守給你的承諾、 提交于 2019-11-29 14:48:03
I'm trying to create something similar to the diggbar. I'm using Visual Studio 2010 and Asp Development server. However, I can't get the ASP dev server to handle the request because it contains "http:" in the path. I've tried to create an HTTPModule to rewrite the URL in the BeginRequest , but the event handler doesn't get called when the url is http://localhost:5957/http://yahoo.com . The event handler does get called if the url is http://localhost:5957/http/yahoo.com To summarize: http://localhost:5957/http/yahoo.com works http://localhost:5957/http//yahoo.com does not work http://localhost

Using Url.RouteUrl() with Route Names in an Area

房东的猫 提交于 2019-11-29 13:09:51
As a side note, I understand the whole ambiguous controller names problem and have used namespacing to get my routes working, so I don't think that is an issue here. So far I have my project level controllers and then a User Area with the following registration: public class UserAreaRegistration : AreaRegistration { public override string AreaName { get { return "User"; } } public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute( "UserHome", "User/{id}", new { action = "Index", controller = "Home", id = 0 }, new { controller = @"Home", id = @"\d+" } ); context

turn URL route into funciton arguments php mvc

会有一股神秘感。 提交于 2019-11-29 12:10:38
I'm writing a custom MVC framework for a PHP project and everything is great until it comes to getting arguments from the URL route. I'm stuck on passing parts of the URL route into a function argument dynamically. I already have a method which is just to implode the route and use the array for the function arguments but I would really like to know how to do it like in CodeIgnitor or CakePHP. Here's what i want to have done. The site url would be... url: http://yoursite.com/profile/view/35/foo and in my controller I would have... <?php Class profileController Extends baseController { public

PageMethods in ASP.NET failed to work if you have ASP.NET Routing Implemented

百般思念 提交于 2019-11-29 11:38:40
I have a web method: [System.Web.Services.WebMethod] public static string getCharacterstics(int product_id, int lang_id) { // code goes here... } I want to access it using PageMethods like: (Provided the condition that i have Enable PageMethods in ScriptManager): <script type="text/javascript"> $(document).ready( function () { $('#characterstics').html("loading"); // '<%= product_id_property %>' , '<%= this.LanguageID %>' PageMethods.getCharacterstics(0 ,0 , OnSave); } ); function OnSave(result) { } </script> I get the error "the http verb post to access path.. is not allowed" I googled it and

Page.RouteData.Values are empty for one page but not another

可紊 提交于 2019-11-29 11:24:58
I have Routing working in ASP.NET c# WebForms using Microsoft.AspNet.FriendlyUrls but not for all pages. Here is an example: routes.MapPageRoute("List/{Location}/{ZipCode}/", "List/{Location}/{ZipCode}/", "~/List.aspx"); On the above mentioned page (List.aspx) in the page_load there are no values.count in the Page.RouteData. Page.RouteData.Values.Count == 0 I have another page in the same site with this info matched to it: routes.MapPageRoute("{Location}/{ZipCode}/{Name}/{LocID}/{ID}/{Code}/", "{Location}/{ZipCode}/{Name}/{LocID}/{ID}/{Code}/", "~/place.aspx"); This page (place.aspx) always

How to enable case-sensitivity under IIS Express?

风格不统一 提交于 2019-11-29 11:19:27
How should I go about enabling case sensitive request handling if using IIS Express? Is there a setting in IIS Express? or can a URL Rewrite rule accomplish this? or perhaps catch-all HTTP Handler to do the case check? The goal is to be able to catch case inconsistencies locally, with respect to static files, before deployment to both IIS and S3 (where S3 is case sensitive). Thanks IIS is case-sensitive... ...but not for files. It is a misnomer that IIS is case-insensitive, it is the Windows file system that is case-insensitive, not IIS. If a URL contains a file path then IIS asks Windows if

How to generate url for a route in Ember.js

久未见 提交于 2019-11-29 09:23:56
I am wondering how is possible to generate url for a given route. My scenario I have list of calls (db entity) and user can select several calls and share them with other people via email. After submition of selected calls is created db row with hash and by relation contains selected calls. Now I need generate link which can be sended by e-mail. This link is not the same route as list of call's route. So the question is: Is it possible to generate url by route and params in Ember.js? Thank you. Luke Melia You can use Router#generate which delegates to the router.js library . Ember 2.5 Example

URL helper in JavaScript

浪子不回头ぞ 提交于 2019-11-29 09:19:49
问题 I'm using jQuery Lightbox for my image gallery. The URL for the button image is ' ../../Content/Lightbox/lightbox-btn-next.gif ' That works fine if my URL is ' localhost/Something1/Somtehing2 ' If I use another route like ' localhost/Something1/Something2/Something3 ' then URL to button images is incorrect. Can I use Url.Action() inside .js files? This is how I call .js files: <script type="text/javascript" src="<%= Url.Content("~/Scripts/jquery.lightbox-0.5.js") %>"></script> 回答1: You can't

Routing HTTP Error 404.0 0x80070002

混江龙づ霸主 提交于 2019-11-29 09:09:04
问题 I have created routing rules in my ASP.NET application and on my Dev machine at IIS7 everything works fine. When I deploy solution to prod server which has also IIS7 I get error 404 (page not found) while accessing URL. Maybe someone could point where is the problem? Actual error HTTP Error 404.0 - Not Found The resource you are looking for has been removed, had its name changed, or is temporarily unavailable. Detailed Error InformationModule IIS Web Core Notification MapRequestHandler

Dot character in ASP.NET MVC 3 route parameters

折月煮酒 提交于 2019-11-29 08:33:59
I have no custom routes in my application, only the default one. If i try to open localhost/myapp/controller/action/bla.bla it works fine on my machine (Windows 7 x32, both Cassini and IIS) but fails on the server (2008 R2 x64). Found similar question but the solution doesn't work. Also, found this article where Eilon says it's a special character for MVC and it's "by design". Why there is difference between my machine and the production box and how do i fix it? Update : the problem site has ExtensionlessUrl-ISAPI-4.0_64bit and ExtensionlessUrl-Integrated-4.0 enabled and mapped to "*.". There