Search Results

Search found 2401 results on 97 pages for 'routing'.

Page 9/97 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Using URL Routing for Web Forms and StopRoutingHandler for Favicon

    - by RandomBen
    I have a website where I need to add a Favicon.ico. The site is written using ASP.NET 3.5 Web Forms with Routing. The issue is that the Favicon link always returns a page not found error. This is because the Routing does not know where the link for Favicon.ico should go to so it returns the Not Found page. I have tried to add a StopRoutingHandler for the the favicon but none of them seem to work. Below are the ones I have tried so far: routes.Add(new Route("MasterPages/{favicon}.ico", new StopRoutingHandler()));; routes.Add(new Route("{favicon}.ico", new StopRoutingHandler())); routes.Add(new Route("favicon.ico", new StopRoutingHandler())); routes.Add(new Route("favicon.ico/{*pathInfo}", new StopRoutingHandler())); Does anyone know what I should be using? My favicon.ico links I have tried look like this: <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /> <link rel="icon" href="/favicon.ico" type="image/x-icon" /> And they are inside of my tags.

    Read the article

  • Routing in Php and decorator pattern

    - by Joey Salac Hipolito
    I do not know if I am using the term 'routing' correctly, but here is the situation: I created an .htaccess file to 'process' (dunno if my term is right) the url of my application, like this : RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+)$ index.php?url=$1 [QSA,L] Now I have this : http://appname/controller/method/parameter http://appname/$url[0]/$url[1]/$url[2] What I did is: setup a default controller, in case it is not specified in the url setup a Controller wrapper I did it like this $target = new $url[0]() $controller = new Controller($target) The problem with that one is that I can't use the methods in the object I passed in the constructor of the Controller: I resolved it like this : class Controller { protected $target; protected $view; public function __construct($target, $view) { $this->target = $target; $this->view = $view; } public function __call($method, $arguments) { if (method_exists($this->target, $method)) { return call_user_func_array(array($this->target, $method), $arguments); } } } This is working fine, the problem occurs in the index where I did the routing, here it is if(isset($url[2])){ if(method_exists($controller, $url[1])){ $controller->$url[1]($url[2]) } } else { if(method_exists($controller, $url[1])){ $controller->$url[1]() } } where $controller = new Controller($target) The problem is that the method doesn't exist, although I can use it directly without checking if method exist, how can I resolve this?

    Read the article

  • ASP.NET web form Routing issue via UNC Path

    - by Slash
    I create a IIS 7.0 website via UNC path to load .aspx to dynamic compile files and runs. however, it's running perfect. I always use IIS URL Rewrite module 2 to rewrite my site URL n' its perfect, too. Today, I wanna use System.Web.Routing to implement url rewrite but I encountered difficulties... When I wrote code in Global.asax: System.Web.Routing.RouteTable.Routes.MapPageRoute("TEST", "AAA/{prop}", "~/BBB/CCC.aspx"); And it just CANNOT reDirect to /BBB/CCC.aspx When I type the URL(like: xx.xx.xx.xx/BBB/CCC.aspx) in browser directly, it runs normally that I want. (so it proof CCC.aspx is in right path.) thus, I copy all of the code and open VS2010 running with IIS 7.5 Express locally, it works perfect! e.g: in browser URL I type xx.xx.xx.xx/AAA/1234, it will turn to page xx.xx.xx.xx/BBB/CCC.aspx (Works perfect!) Why??? help me plz. thanks. Update: I think I should consider not UNC path to make it error! when I move all code to physical disk and setup IIS 7.0 to monitor this Folder, it still not works! But the same code run in VS2010 + IIS 7.5 Express it works!? so strange!

    Read the article

  • Problem Routing domains subfolder

    - by hkda150
    Hi there, I'm pretty new to ASP.NET MVC and I hope it is not a too silly question. So here it comes. I have ... a ASP.NET MVC application with a domain similar to http://mydomain/mysubfoler1/myappfolder My problem... The problem for me is the routing of my application (it worked fine without using a subfolder after the domain-name). The applications homepage loads not to bad, with css files but without ressources like images (defined in css files) and without jQuery ajax calls similar to /mycontroller/myaction links are only working once (the second time I get a page similar to this link: http://mydomain/mysubfoler1/myappfolder/myController/myController/myAction) Here's my Global.asax contaning the routing: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", "{controller}/{action}/{id}", new { controller = "myController", action = "Index", id = "" } defaults ); routes.MapRoute( "Root", "", new { controller = "myController", action = "Index", id = "" } ); } protected void Application_Start() { ViewEngines.Engines.Clear(); ViewEngines.Engines.Add(new MyApplicationWeb.LocalizationWebFormViewEngine()); RegisterRoutes(RouteTable.Routes); //RouteDebug.RouteDebugger.RewriteRoutesForTesting(RouteTable.Routes); } Any suggestions? My first suggestion was to use areas like: "mysubfolder1/myappfolder/{controller}/{action}/{id}" (but without any luck) Thank you very much for your help!

    Read the article

  • URL Based Internal Redirecting

    - by bculverscate
    Basically, we have one external IP address, several servers internally and want to redirect to each internal server based on request URL. We do not want to install another piece of hardware to do this for us but we have a firewall running Linux that currently forwards to only one of the internal servers. Example of our setup can be seen here: http://img23.imageshack.us/img23/5469/drawing1br.jpg NOTE: domain.com does not point to this box nor would we like it to. Subdomains are pointed manually to our global IP address.

    Read the article

  • ASP.net MVC Routing problem

    - by Ready Cent
    I have deployed my ASP.net MVC site to a shared hosting company. The problem is that now none of the pages except for the home page work. For example if I go to /Account/Register I get a page not found. However, if I go to /Account/Register/Index.aspx then it does work. I have tried modifying the routing to add in that index.aspx but everything I have tried fails.

    Read the article

  • ASP.NET Routing not working when deployed under IIS,Works in IDE

    - by Shyju
    I have an ASP.NET web application developed in VS 2008 and i have implemented ASP.NET web forms URL routing by following this link http://www.4guysfromrolla.com/articles/051309-1.aspx#postadlink It works pretty good when i run it on the Visual studion IDE.But does not works when i created a site under my IIS and deployed the same files there.I have set ASP.NET version as 2.0 in the Properties window of my application too.But does not work. Any idea Why ? Is there anything else to be setup ? Thanks in advance

    Read the article

  • URL routing documentation question.

    - by James Evans
    I'm reading about URL routing at How to: Define Routes for Web Forms Applications and there's something in the example I don't understand. If you look at the example provided below, routes.MapPageRoute("", "SalesReport/{locale}/{year}/{*queryvalues}", "~/sales.aspx"); specifically at "SalesReport/{locale}/{year}/{*queryvalues}" Why does queryvalues have an asterisk in front of it and locale and year don't?

    Read the article

  • asp.net 4.0 web forms routing - default/wildcard route

    - by Martin Robins
    I there a simple way when using ASP.NET 4.0 routing with Web Forms to produce a route that will act as some kind of wildcard? It seems to me that within WebForms, you have to specify a route for every page - I am looking for some kind of generic route that can be used where nothing specific is required, perhaps mapping directly from path to path so... http://somedomain.com/folder1/folder2/page would possibly map to folder1/folder2/page.aspx Any suggestions? Thanks

    Read the article

  • Ruby on Rails wildcard routing such as /foo.htm /foo.php /foo.something

    - by fregas
    I'm trying to create a routing situation where by default, any URL's such as this: /foo /something /foo.php /somethingelse.xml /something.something.else etc. will all route to one controller, assuming they don't route anywhere else. i can get this to work with the following code in my routes: map.myroute '/:file_or_folder', :controller = 'mycontroller' this works fine as long as there are no dots in the URL: /something but this wont work: /something.foo any ideas?

    Read the article

  • RoR Beginner Routing error

    - by WANNABE
    I've created a DB and a table within that DB called genre. Now when I try to connect to this using the URL, I get the following error message: Routing Error No route matches "/genre" with {:method=:get} Thanks for your help in advance.

    Read the article

  • Routing without a controller and action name

    - by Eden
    Hi, I've a very basic ASP.NET MVC application that uses the default routing. Now I need to route all the requests that comes with out a specific URL to one action with a single parameter. Examples: www.myapp.com/2374982 www.myapp.com/3242342 should be routed to the same action: public ActionResult ViewById(intid) .... Thanks, Eden

    Read the article

  • Changing the id parameter in Rails routing

    - by japancheese
    Hello, Using rails3 new routing system, is it possible to change the default :id parameter resources :users, :key => :username come out with the following routes /users/new /users/:username /users/:username/edit ...etc I'm asking because although the above example is simple, it would be really helpful to do in a current project I'm working on. Is it possible to change this parameter, and if not, is there a particular reason as to why not?

    Read the article

  • url routing access denied

    - by user1600319
    I put the code RouteTable.Routes.MapPageRoute("md", "page1.html/{zxc}", "~/withmaster/page2.aspx"); at golbal Application_Start event .At masterpage link_event Response.Redirect(Page.GetRouteUrl("md", new { zxc = "data" })); Everything ok at local and iis7. The problem is that when i run this on the hosting The access to requested URL has been denied. Do i need some more thing to use url routing ...

    Read the article

  • Url routing asp.net 4

    - by user510336
    Hello all , I am trying to create url routing like this http://msdn.microsoft.com/en-us/magazine/dd347546.aspx but I am having few questions , first why he is adding lines to the web.config , I tested it and it didnt appear that they're doing something as I commented them and nothing major appeared second I am having this line of code that is crashing var display = BuildManager.CreateInstanceFromVirtualPath(_virtualPath,typeof(Page)) as IProfileHandler; when casted as ihttphandler it's working , but when I am casting it to iprofilehandler(which is implemeting ihttphandler) it's giving null !

    Read the article

  • url routing with strongly typed objects

    - by user510336
    hello all , I am trying to create url routing with strongly typed objects for pages but I keep getting null object on the first line so it's crashing //Getting the suitable executing Page var display = BuildManager.CreateInstanceFromVirtualPath(_virtualPath,typeof(Page)) as IProfileHandler; //Setting Page Parameters display.MemberId = Convert.ToInt32(requestContext.RouteData.Values["ID"]); //Return Page return display; public interface IProfileHandler : IHttpHandler { int MemberId { get; set; } }

    Read the article

  • Routing optional parameters with dashes in MVC

    - by Géza
    I've made an routing definition like this: routes.MapRoute("ProductSearch", "Search-{MainGroup}-{SubGroup}-{ItemType}", new { controller = "Product", action = "Search", MainGroup = "", SubGroup = "", ItemWebType = ""}); It is not working if the parameters are empty. Actually it resolves the url, so Url.Action method resolves the path "Search-12--" but the link is not working, so the GET of the page is not working With slashes it is working the Url.Action method makes "Search/12" "Search/{MainGroup}/{SubGroup}/{ItemType}" is it somehow possible to correct it?

    Read the article

  • ASP.NET Routing : RouteCollection class missing

    - by Shyju
    I am developing a website(web forms , not MVC) in VS 2008(with SP1 ).I am trying to incorporate the ASP.NET Routing.I am following the MSDN tutorial to do it. http://msdn.microsoft.com/en-us/library/cc668201.aspx I have added the below items to my glbal.asax.cs file as per the tutorial protected void Application_Start(object sender, EventArgs e) { RegisterRoutes(RouteTable.Routes); } public static void RegisterRoutes(RouteCollection routes) { routes.Add(new Route ( "Category/{action}/{categoryName}" , new CategoryRouteHandler() )); } When trying to build it is telling like "The type or namespace name 'RouteCollection' could not be found (are you missing a using directive or an assembly reference?) I have System.web imported to my global.asax file Any Idea how to get rid of it ?

    Read the article

  • ASP.NET MVC JavaScript Routing

    - by zowens
    Have you ever done this sort of thing in your ASP.NET MVC view? The weird thing about this isn’t the alert function, it’s the code block containing the Url formation using the ASP.NET MVC UrlHelper. The terrible thing about this experience is the obvious lack of IntelliSense and this ugly inline JavaScript code. Inline JavaScript isn’t portable to other pages beyond the current page of execution. It is generally considered bad practice to use inline JavaScript in your public-facing pages. How ludicrous would it be to copy and paste the entire jQuery code base into your pages…? Not something you’d ever consider doing. The problem is that your URLs have to be generated by ASP.NET at runtime and really can’t be copied to your JavaScript code without some trickery. How about this? Does the hard-coded URL bother you? It really bothers me. The typical solution to this whole routing in JavaScript issue is to just hard-code your URLs into your JavaScript files and call it done. But what if your URLs change? You have to now go an track down the places in JavaScript and manually replace them. What if you get the pattern wrong? Do you have tests around it? This isn’t something you should have to worry about.   The Solution To Our Problems The solution is to port routing over to JavaScript. Does that sound daunting to you? It’s actually not very hard, but I decided to create my own generator that will do all the work for you. What I have created is a very basic port of the route formation feature of ASP.NET routing. It will generate the formatted URLs based on your routing patterns. Here’s how you’d do this: Does that feel familiar? It looks a lot like something you’d do inside of your ASP.NET MVC views… but this is inside of a JavaScript file… just a plain ol’ .js file.  Your first question might be why do you have to have that “.toUrl()” thing. The reason is that I wanted to make POST and GET requests dead simple. Here’s how you’d do a POST request (and the same would work with a GET request):   The first parameter is extra data passed to the post request and the second parameter is a function that handles the success of the POST request. If you’re familiar with jQuery’s Ajax goodness, you’ll know how to use it. (if not, check out http://api.jquery.com/jQuery.Post/ and the parameters are essentially the same). But we still haven’t gotten rid of the magic strings. We still have controller names and action names represented as strings. This is going to blow your mind… If you’ve seen T4MVC, this will look familiar. We’re essentially doing the same sort of thing with my JavaScript router, but we’re porting the concept to JavaScript. The good news is that parameters to the controllers are directly reflected in the action function, just like T4MVC. And the even better news… IntlliSense is easily transferred to the JavaScript version if you’re using Visual Studio as your JavaScript editor. The additional data parameter gives you the ability to pass extra routing data to the URL formatter.   About the Magic You may be wondering how this all work. It’s actually quite simple. I’ve built a simple jQuery pluggin (called routeManager) that hangs off the main jQuery namespace and routes all the URLs. Every time your solution builds, a routing file will be generated with this pluggin, all your route and controller definitions along with your documentation. Then by the power of Visual Studio, you get some really slick IntelliSense that is hard to live without. But there are a few steps you have to take before this whole thing is going to work. First and foremost, you need a reference to the JsRouting.Core.dll to your projects containing controllers or routes. Second, you have to specify your routes in a bit of a non-standard way. See, we can’t just pull routes out of your App_Start in your Global.asax. We force you to build a route source like this: The way we determine the routes is by pulling in all RouteSources and generating routes based upon the mapped routes. There are various reasons why we can’t use RouteCollection (different post for another day)… but in this case, you get the same route mapping experience. Converting the RouteSource to a RouteCollection is trivial (there’s an extension method for that). Next thing you have to do is generate a documentation XML file. This is done by going to the project settings, going to the build tab and clicking the checkbox. (this isn’t required, but nice to have). The final thing you need to do is hook up the generation mechanism. Pop open your project file and look for the AfterBuild step. Now change the build step task to look like this: The “PathToOutputExe” is the path to the JsRouting.Output.exe file. This will change based on where you put the EXE. The “PathToOutputJs” is a path to the output JavaScript file. The “DicrectoryOfAssemblies” is a path to the directory containing controller and routing DLLs. The JsRouting.Output.exe executable pulls in all these assemblies and scans them for controllers and route sources.   Now that wasn’t too bad, was it :)   The State of the Project This is definitely not complete… I have a lot of plans for this little project of mine. For starters, I need to look at the generation mechanism. Either I will be creating a utility that will do the project file manipulation or I will go a different direction. I’d like some feedback on this if you feel partial either way. Another thing I don’t support currently is areas. While this wouldn’t be too hard to support, I just don’t use areas and I wanted something up quickly (this is, after all, for a current project of mine). I’ll be adding support shortly. There are a few things that I haven’t covered in this post that I will most certainly be covering in another post, such as routing constraints and how these will be translated to JavaScript. I decided to open source this whole thing, since it’s a nice little utility I think others should really be using. Currently we’re using ASP.NET MVC 2, but it should work with MVC 3 as well. I’ll upgrade it as soon as MVC 3 is released. Along those same lines, I’m investigating how this could be put on the NuGet feed. Show me the Bits! OK, OK! The code is posted on my GitHub account. Go nuts. Tell me what you think. Tell me what you want. Tell me that you hate it. All feedback is welcome! https://github.com/zowens/ASP.NET-MVC-JavaScript-Routing

    Read the article

  • Different controllers with the same name in two different areas results in a routing conflict

    - by HackedByChinese
    I have two areas: ControlPanel and Patients. Both have a controller called ProblemsController that are similar in name only. The desired results would be routes that yield /controlpanel/problems = MyApp.Areas.ControlPanel.Controllers.ProblemsController and /patients/problems = MyApp.Areas.Patients.Controllers.ProblemsController. Each has routes configured like this: public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute( "**Area Name Here**_default", "**Area Name Here**/{controller}/{action}/{id}", new { action = "Index", id = UrlParameter.Optional } ); } where **Area Name Here** is either ControlPanel or Patients. When I go to /patients/problems/create (for example), I get a 404 where the routing error says: A public action method 'create' was not found on controller 'MyApp.Areas.ControlPanel.Controllers.ProblemsController'. I'm not sure what I'm doing wrong.

    Read the article

  • Rails Routing Broken In Production - Caching of routes.rb suspected

    - by ming yeow
    Hi folks, i have an urgent problem. Essentially, my routing works on my localhost. But when i deployed this to production, the routes does not seem to work correctly. For example, given a new route "/invites" - sometimes i will get a 404, and sometimes it will work correctly. I suspect there is some caching going on somewhere, but i am not sure. Logs: when a page is not found (when the routes are supposed to be accurate) Processing UsersController#network (for 67.180.78.126 at 2010-06-01 09:59:31) [GET] Parameters: {"id"="new"} ActionController::RoutingError (No route matches "/comm/role_playing_games" with {}): app/controllers/application_controller.rb:383:in prev_page_label' app/controllers/application_controller.rb:238:in log_timed_info' app/controllers/users_controller.rb:155:in network' app/controllers/users_controller.rb:151:in network' app/controllers/application_controller.rb:44:in turn_on_query_caching' app/controllers/application_controller.rb:43:in turn_on_query_caching' app/controllers/application_controller.rb:42:in turn_on_query_caching' app/controllers/application_controller.rb:41:in turn_on_query_caching' app/controllers/application_controller.rb:40:in turn_on_query_caching' app/controllers/application_controller.rb:39:in turn_on_query_caching' haml (3.0.6) lib/sass/plugin/rack.rb:41:in `call' Rendering /mnt/app/releases/20100524233313/public/404.html (404 Not Found)

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >