Click here to Skip to main content
15,881,882 members
Everything / Routing

Routing

routing

Great Reads

by Tomáš Růt
Simple explanation of bobril routing mechanism
by Houssem_Dellai
Creating a Web API service that gets tweets and hosting it on Windows Azure.
by ASP.NET Community
MVC routingIn ASP.NET MVC 3 one of the main parts is routing. The routing is helps to map the particular view and particular controller.When we
by Shahriar Hossain
Learn how to do A/B testing in Azure

Latest Articles

by Syed Zain Shah
This article tells you about the convention-based Routing and Attribute Routing in detail. Feel free to give your feedback.
by Tomáš Růt
Simple explanation of bobril routing mechanism
by Shahriar Hossain
Learn how to do A/B testing in Azure
by pravin kambari
I am going to explore Routing in AngularJS and call a WCF service from AngularJS by creating common factory with $http service

All Articles

Sort by Score

Routing 

13 Aug 2017 by Tomáš Růt
Simple explanation of bobril routing mechanism
26 Nov 2019 by Afzaal Ahmad Zeeshan
What you are looking for is to be done on the runtime, and these attributed at mapped at compile-time. You will not be able to modify them after your app has been built. One way to solve this would be to use a dynamic route and then process the actual URI on runtime and execute the...
14 Jul 2013 by Ron Beyer
Regex.Split takes 2 strings, an input and a pattern. You are trying to use Regex.Split like its String.Split. Basically your Regex is invalid, probably throwing an exception, and then the parts underneath are not being run.Instead of using Regex.Split, use String.Split, like: ...
6 Nov 2013 by Houssem_Dellai
Creating a Web API service that gets tweets and hosting it on Windows Azure.
8 Feb 2017 by F-ES Sitecore
The site you are trying to access doesn't want you accessing it from your own javascript, there is nothing you can do about this.
9 Feb 2017 by Richard Deeming
The code from the blog post you linked to needs to be used on the remote server being requested, not in the client making the request.The cross-origin restrictions are there to prevent malicious code from making unauthorised requests to remote resource. If it was possible for the client to...
10 Sep 2012 by aref.bozorgmehr
hi sorry i cant write English very wellwhen i use Routing in my program i can't to use a tag for example :in result-search Pagewhen user come to www.namesite.com/result-search/love
11 Sep 2012 by aref.bozorgmehr
i use a tag for link and bind herf in a tag with db
11 Sep 2012 by mamali
salam , moshkelet o farsi ham begi inja kheili irani hast negaran nabash
11 Sep 2012 by aref.bozorgmehr
ok mamnoonmoshkelam roo tozih dadam age komak konid mamnoon misham
26 Nov 2012 by kozmikadam
Hi ,I have a little problem.My asax : void Application_Start(object sender, EventArgs e) { // Code that runs on application startup RouteTable.Routes.MapPageRoute("article_url_name",...
1 Dec 2012 by zhuk1980
Hello, everybody.I developed a wcf routing service. It accepts calls on one TCP port and will redirect on some destination services. The router listening on NetTcpBinding. Destination services are on NetNamedPipeBinding.A problem occurs when carryed out load testing. It appeared that the...
6 Dec 2012 by Keithen.Leo
For some reason,I want to create webapi route template like this:HttpConfiguration.Routes.Add("DomainDefaultApi", new DomainHttpRoute("{controller}.12345.com", "api/{id}", new System.Web.Http.Routing.HttpRouteValueDictionary(new { id = RouteParameter.Optional })));I create the...
24 Dec 2012 by NAPorwal(8015059)
hello,I have used routing in my website but when it redirecting to the requested page .js files are not working plz help me
25 Dec 2012 by NAPorwal(8015059)
Hi I have solved my problem please refer this link when facing problem whith ajax or js file when using url rewriting this link really has a grt solutionhttp://www.iis.net/learn/extensions/url-rewrite-module/url-rewriting-for-aspnet-web-forms#Form_postback_URL
9 Feb 2013 by DevAffair
I have a project written in asp.netall the pages have names in Hebrew and are listed under a folder named: "StaticContent".What I wish to do, is simply remove the /staticContent/ and the ".aspx" from the url.Meaning, a url that is currently:...
18 Apr 2013 by Sandeep Mewara
It does not work like this here.Here is what is expected of enquirers:1. TRY first what you want to do! You may find that it's not that hard.2. Formulate what was done by you that looks like an issue/not working. Try them and tell if you face issues.Members will be more than happy...
22 Apr 2013 by Sergey Alexandrovich Kryukov
Yes, you can. Each package going up has to spend energy to work against gravitation. The energy needed to move up is equal to m×g×h, where g is the gravitational field of the Earth, the same as the acceleration of the free falling body and h is the elevation, and m is the mass of the package....
29 Apr 2013 by elagamy
All pages work correctly with routing but when selecting a menuitem (in masterpage) to go a page, it does not go to the selected page. When I enter product page with path localhost:3806/yarrow/Products/35 then click on home menuitem, it gives me this path...
30 Apr 2013 by Vygandas Pliasas
Hello,I have configured my dedicated server to link domains with default port (80) to my nodejs ports accordingly to domain name. E.g. site1.com to port 2222 and site2.com to port 3333.My question is how to pass a subdomain name as a parameter, e.g.:param1.site1.com:80 should go to...
2 May 2013 by pdoxtader
I would respectfully submit that localhost:3806/yarrow/Default.aspx is not, in fact, the correct path, and that the other is. I also think that your code may work as-is if you simply remove the tildes (~).
16 May 2013 by Salah Abualrob
hi,h am using tinymce rich textbox, when i do not use url routing it works fine, but when i use it, normal textbox appear, is there any relation between routing and rich textbox ?i am using asp.net c# and this is the code
22 Jun 2013 by Seshu The Baadshah
Hi ,I am new in concept of url rewriting and I really need a help for it.I have done url rewrite by using routing and locally it is working fine but when I am uploading it on live , it is showing page not found. I am unable to understand the problem as it is working fine in local....
22 Jun 2013 by Parwej Ahamad
Make sure to add Modules and Handlers in Web.Config file: name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, ...
9 Jul 2013 by Aaron @ Think Software
If haproxy redirects the site to the specific server and port, the host name should still stay the same in the users browser so you should be able to extract the subdomain from the hostname and then redirect on the site to the specific folder relating to the subdomain such as Apache's...
16 Jul 2013 by vaddilli sarat
Hi i am getting the following error while submitting the form Stack Trace:[InvalidOperationException: The RouteData must contain an item named 'path' with a non-empty string value.] System.Web.Routing.RouteData.GetRequiredString(String valueName) +2341517 ...
24 Jul 2013 by Member 10003613
Hello Friends.AutoCompleteExtender is not working with URL Routing.when i am commenting the the RegisterRoutes then AutoCompleteExtender is works. i mean that with URL Routing AutoCompleteExtender not working.& i think that AutoCompleteExtender is working with Web Services.so it may...
24 Jul 2013 by Brij
Yes It does not work while working with url routing. You need to make a fix for it. Refer the below URLhttp://stackoverflow.com/questions/9988551/asp-net-url-routers-conflict-with-ajax-webservice-path[^]
15 Sep 2013 by Umapathi K
I am binding here href link in tag from database. i used below coding to routing the URL but i am unable to redirect with exact page, which url i am binding into the href tag, the same data displaying in browser URL. in .cs pageTEST12");in global.asax pageprivate...
26 Sep 2013 by GlBr
Right, so I was working on developing a website(just a beginner though). I have stuck at this issue of generating a unique url for each user who registers on my site. Now say my site is named, www.mydomainname.com As of now every user has a profile which has the same url, regardless of the...
26 Sep 2013 by OriginalGriff
The easiest way is to use url rewriting - see here: http://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/[^]
8 Oct 2013 by Jack R. Schaible
I have a route config file that I'm trying to route all URLs that follow the formula .com/{a page}/{a subpage}, to route to a specific page .com/Default/Page.aspx. My problem is that it does this for all the pages (i.e., .com/Account/Login.aspx. Is there a way to specify that I want it to route...
11 Oct 2013 by ASP.NET Community
MVC routingIn ASP.NET MVC 3 one of the main parts is routing. The routing is helps to map the particular view and particular controller.When we
6 Nov 2013 by dhl_hh
Hi,I am to implement a router firmware customization to enhance the routing of IPv4 and IPv6 within the same network infrastructure. for this I have decided to use dd-wrt open source firmware to implement my solution. I would be really grateful if I could obtain your expert advice on...
8 Nov 2013 by Lovewateruni
Can you share me a link or sources for simulator routing!I searched but I didn't find anything!please help me!
8 Nov 2013 by Lovewateruni
my exercises is built a program for support routing RIP.I think first, I simulate a router, a host... but I don't fine a sources to start...:(
29 Nov 2013 by Eduardo Fonseca
I would like to know what is better to use. I understand one can have same behavior depending on how routes are configured.Question is if one starts defining routes for multi tenancy such as{tenant}/{controller}/{workorder}, what would be better.1. Having route per tenanat?2. Using...
16 Jan 2014 by Frank1982
Hi,I have implemented routing on my website and almost everything works fine but I get an error message for any include because the path is wrong cause of the routing.I try to be more clear and show my code.Starting from my link in my home page
18 Jan 2014 by Frank1982
Hi guys, I am getting an error in a routed page when I click on a link that should open another routed link, but it seems that the code makes a loop I don't understand why and where.Here the code in the global.asaxSub RegisterRoutes(ByVal routeCollection As RouteCollection) ...
19 Jan 2014 by Frank1982
I was going from search-by-typology.aspx towards article.aspx but in the article's codebihind I have got a response.redirect(search-by-typology.aspx) old style redirect and it was going back so when I have commented that row the issue disappeared.I hope this help someone else.Thank you...
20 Mar 2014 by Er. Ajay Chauhan
According to me, you can find this functionality in MVC application.
20 Mar 2014 by mrityunjay3601
protected void lnkForward_Click(object sender, EventArgs e) { try {string UserName=Session["UserName"].ToString();string url = "~/Page2/" +UserName;Response.Redirect(url, false); } catch (Exception) { throw; } }in Web.config
10 Apr 2014 by Michal Zubek
Hello,I would like to have many instances of the same service at the server.Unfortunately, I cannot use multi-threads (3rd party dll's does not support multi-thread)I thought to have some kind of router/switch which will get request from the client and depend on the occupancy of...
10 Apr 2014 by Member 10412237
Given two firewalls,one border router, one layer 3 switch and two routers, how can i design asecure network required to support two functional units of my organisation(all in the same site)My organisation hosts a web server and has an e-mail server. Also the employees can connect to the...
18 Jul 2014 by sheryi26
Hi,I am working on a news website, Asp.net 4.0 C#I want to perform URL Rewriting, I read many pages and did its instructions, but it has not been working properly!It is my main URL: http://news.ariavid.com/articles.aspx?id=3I wrote these codes in Global.asax:add this...
15 Sep 2014 by Member 11083257
I am using Kendo TabStrip for loading my partial views.But found problems in maintaing urls for different ajax requests for actions in controllers.Here is some code to make it more clear:In my _layout.cshtml view: @(Html.Kendo() .Menu() .Name("HQmenu") ...
16 Sep 2014 by dedamu
Hi,We are using Asp.net Webforms Framework 4.0.We added routing, previously we were sending data in httpcontext and server.transfer.We are sending 6 set of values to another page.How do we send these data to another page? Best Regards,Damodar
10 Feb 2015 by Jeroen E
From an MVVM application I get the following URL for delete: http://localhost/Recruiters/Addresses(guid '7777-777')/CIP.Domain.AddressesI did not fill complete guid in the example URL, but it is a valid one.This URL is not a normal OData route, so I created an routing...
13 Feb 2015 by Mike Hankey
I may just tired, frustrated and grabbing at straws but here goes.I tried using Areas in my MVC Web app and was running into issues with resolving paths so I moved my admin page back in to the main area.When I did the Admin controller gets called which in turn invokes the Admin/Index...
13 Feb 2015 by Mike Hankey
It turns out I had used the UserViewModel on the _Layout page to fill in some user information and it appears that the _layout view model trumps all other down the chain. Which I guess makes sense but once I changed it everything fell into place.
16 Feb 2015 by Kornfeld Eliyahu Peter
Namespace is irrelevant here...All you have to do is include the area name in your link...@Html.ActionLink("Action", "Controller", "ActionName", new { area = "Area" })
16 Feb 2015 by Jeroen E
There were two problems with this as it turns out:First:My web.config was not properly set up to handle a dot in the URL.So I changed it to this: verb="*" type="System.Web.Handlers.TransferRequestHandler" ...
22 Feb 2015 by Pravesh Singh
I’m working on url routingI want to redirect page without change url.When type url www.example.com/Default.aspx that time url show as same but return page Home/Index (Controller/Action)I want to redirect page with actual url.And second require is when type...
22 Feb 2015 by RajeeshMenoth
Hi,Ref :Routing in MVC
7 May 2015 by exoc
Hi!I'm searching for help for my current asp.net project. What I'm trying to do is this:The user should be able to use this url"http://domain.tld/page/param1" where page is my asp.net page and param1 is a changing parameterand he should be routed/mapped...
10 May 2015 by talebi2109
HiI am on a project which includes different nodes one node is source of the stream and another sink of that stream and there are some intermediate nodes between them. i have these assumptions:1. each node can ping the neighbor one 2. but there is no guarantee that this is possible for...
19 May 2015 by SahilKataria
So, here are my requirements. I am building a multi-tenant site where companies after they sign up get their own subdomain. Assume that my business is called Email Jobs Inc with domain www.emailjobs.com. This site is hosted in a shared ISP environment so I have very limited access to IIS...
20 May 2015 by Member 11705500
I want to implement IP.Board (which is a forum application: http://www.invisionpower.com/apps/board/) in Zend, but it's not a module, it has its own code and runs by itself. How can I make a route to that directory, so it can just start functioning on its own?I plan to put the forum into a...
27 May 2015 by aspdotnetkhan
Hi,I am using 'Intelligencia UrlRewriter' it is working fine in local server but on godaddy server it is showing error.website hosted on godaddy. http://fzkforum.com/bscore/http://fzkforum.com/rome-the-worlds-first-superpower-17.aspxWINDOWS, Asp.net 4.0/4.5 and ISIS 7 are...
27 May 2015 by Shivachalappa Gotur
Hi, have you modified the webconfig file as shown, in dotnetguts.http://dotnetguts.blogspot.ae/2008/07/url-rewriting-with-urlrewriternet.htmlPlease modify it as shown and try.
7 Jun 2015 by aspdotnetkhan
Hi,This below code snippet working with SQL query i wrote in code behind.' NavigateUrl=''> ...
15 Jul 2015 by Sergey Alexandrovich Kryukov
Please see: https://msdn.microsoft.com/en-us/library/cc668201(v=vs.140).aspx[^] and URL Routing with ASP.NET 4.0[^].—SA
30 Jul 2015 by Alan Balkany
My controller action with two parameters is never called. Can anyone see what I'm doing wrong?URL: /api/JobTitle/1/55 (The arguments are 1 and 55.)ROUTE: config.Routes.MapHttpRoute( name: "With2Ids", routeTemplate: ...
9 Aug 2015 by jyoti mahalik
Hi,I have implemented ARR reverse routing in IIS 8.5 ...
16 Aug 2015 by Shahriar Hossain
Learn how to do A/B testing in Azure
13 Sep 2015 by F-ES Sitecore
You can use the FormCollection to process the post dynamicallyGetting Data From View to Controller in MVC[^]
6 Oct 2015 by Ray Wampler
I have a .Net 4.5 Web API 2 application that runs fine locally through Visual Studio on IIS Express but does not run when deployed to a server.The deployed server is 2008 R2 SP1 with IIS 7.5 and .Net 4.5.2 installed.On the deployed website when I go to the root instead of showing the...
13 Oct 2015 by FoxRoot
I have a project that serves some blog data and pictures. I created controllers and also actions for both blog and pictures. I updated Global.asax.cs to create user friendly urls. No problem till here. Now I want to add a simple controller which is Comment and an action which is...
13 Oct 2015 by Krunal Rohit
As I can see from you code, you have created different routes for your each action.And pity that you've updated the default route too.So now if you want to add one new action, you have to create the new route for that. Something like this:routes.MapRoute( "Comment", ...
18 Oct 2015 by Sanjith S
which is the suitable algorithm for spatial Routing in sql server 2012??i just heard about brute force algorithm and a*..which one gives an optimum solution?and their difference...and how to find the shortest path in sqlserver(Codes and steps)
6 Jan 2016 by Mohsen.srn
ok, the problem solved by myself. public ActionResult singleQuestion(int id, string slug) { var questions = BQcnt.Questions; var showQuestion = questions.Find(id); if (showQuestion != null) { var...
27 Jan 2016 by Ray Wampler
Yes, the problem was that we had an old build script for a classic ASP.Net app and so it was not publishing the Views and Areas folders. Once we had all the .cshtml files on the server it worked fine.
29 Apr 2016 by Richard Deeming
You don't.In order for the browser to execute your script, it has to be able to download your script. If you prevent the user from downloading your script, then your prevent the browser from executing your script, and you break your site.Any operation which needs to be kept secret should...
6 Jul 2016 by Abhijit Parab
I have 2 App servers where I have hosted two websites. both applications are running on different port.Now I want to configure ARR server which will route request to these two APP servers. How can I configure APP servers on ARR with different Port in same server Farm ?For example...
17 Jul 2016 by SuRaj Dedhia
I have website developed in vb.net. I have many pages which is template based means structure is same just according to parameters it's page name & content gets changed. So I have define routing in my global.asax file. Problem is it is working only for one page which is on top. in following...
17 Jul 2016 by Kornfeld Eliyahu Peter
From the point of view of the mapper, these two mappings are the same, so everything that fits the second also fits the first and therefore you never will be redirected to the second...Try something like this:Private Shared Sub RegisterRoutes(routes As RouteCollection) ...
18 Jul 2016 by Member 11376647
insted of this url : www.mysite.com/Home/Loginhome is the controller Login is the action .I add string before the controller :www.mysite.com/MyClub/Home/Loginand for example when i type: www.mysite.com/MyClub/Home/HomePageat first its goes to HomePage but after it goes to also to...
18 Jul 2016 by Vignesh Mani
HI Friend,You are using extra one in your routing "{club}" so wherever you redirect from one controller to another controller or one page to another page you use club in you redirection in your MVC Project.
19 Jul 2016 by Pedro Luis Gil Mora
Since script can't be loaded inside templates, due to Angular's jQLite wasn't written to achieve it, I decided to add jQuery library before Angular since it checks for jQuery existence, and voila!, it works. But, the fact that I'm here asking a question, means that there's a 'but', so, the...
30 Sep 2016 by pykos
Hello im having a problem setting up a route in my web api 2 project. I cannot seem to be able to create this kind of route with attribute routing/api/{controller}/?object_id=5It allways comes bact as 404...If I type /api/{controller}/object?object_id=5 I get the results that I...
30 Sep 2016 by David_Wimbley
The way web API routes work is you need to addconfig.MapHttpAttributeRoutes();To your WebApiConfig.cs file if it isn't there.Then as for the route you have two attributes to keep in mind, RoutePrefix and Route.So an example of this would...
7 Nov 2016 by Member 12824529
I have autogenerated MVC set; and in this particular case, I'm utilizing only the Details and Edit view pages, as the id is determined elsewhere and create, delete, and index are all not applicable. Consequently, I have a different controller directly invoking the Details page with the id and...
7 Nov 2016 by Passion4Code
Hello,If you are posting the form and saving, then after successfully saving, return the user to the Details page using the RedirectToAction method.Controller.RedirectToAction Method (System.Web.Mvc)[^]This will redirect the user and land the user to the desired page.Thanks
3 Aug 2017 by Member 12658724
I have the routes. public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute("SurveySubmitRoute", "Survey/Submit", defaults: new {action = "Submit", controller =...
3 Aug 2017 by Kornfeld Eliyahu Peter
"Survey/Language{languageName}...
6 Sep 2017 by dilzz
Dear Experts, I have a question regarding the usage of ajax post call while using the MapPageRoute code in global.asax . I'll show you some example that i have used. In the Global.asax File Code looks like this. protected void Application_Start(object sender, EventArgs e) { ...
6 Sep 2017 by koklimabc
In markup view/fontend page, Have you put every your $.ajax inside $(document).ready(function(){ $.ajax({}); }) for automatic calling or event binding to control that said. one more things i check out this is mistakes url: "InitialClaimReport/populate_User", Do not put "" (double...
27 Dec 2017 by Member 13596834
Among all of the nodes in the RPL dodag, one of them will select the worst parent as its preferred parent i.e. the node wont follow the objective function to select the best one as the other nodes. Ans then it will update the parent set and again selects the worst one and keeps doing so over and...
27 Dec 2017 by Richard MacCutchan
If you do not understand their product then try one of the relevant sites for documentation and/or help forums: Contiki and Cooja - Google Search[^].
20 Apr 2018 by Ger Hayden
I have four dropdowns each in its own viewcomponent. I dont want to impose an order on how the user select from them - each one will filter the contents of the other three and the perspective of the user will govern which one they start from. Taken in order the route would be: ...
20 Apr 2018 by Ger Hayden
Now Im thinking of introucing a new lead parameter called "journeySelectors". The value of "journeySelectors" will be interrogated to decide what of the four driving parameters have values need to be handled. "journeySelectors" will follow the example of "enDays" here from github
18 Jun 2018 by Tony Girgenti
Hello, I have an Asp.Net 4.5.2 web application client that makes calls to a OAuth 2.0 application running on my server Core 2.0 website. It works without a problem. The problem is when it returns from an authorization call to the server, it does not execute the return method specified in the...
16 Jun 2018 by Mehdi Gholam
Read the following : Authenticate with OAuth 2.0 in ASP.NET Core 2.0 • Jerrie Pelser's Blog[^]
18 Jun 2018 by Tony Girgenti
To fix this issue, I added this route to the Startup.cs file: routes.MapRoute( name: "token", template: "token", defaults: new { controller = "API", action = "GetAccessToken" });
5 Jul 2018 by Jinto Jacob
You have some issue in routes Quote: route - controller/action {brand}-car-prices -> /PriceList/PricesByBrand (For example : "toyota-car-prices") {color}-{brand}-car-prices -> /PriceList/PricesByColorAndBrand {for example : "green-toyota-car-prices"} {modelyear}-car-prices ->...
26 Feb 2019 by Noor Mahdi
Hi, Need help to know if this is possible in ASP.Net MVC5 I want to set up routing such that 1. www.myWebsite.com points to Home/Index and 2. www.myWebsite.com/2/3 points to Chapter/Index I have a HomeController with a parameterless Index action (which works fine with the default route...
26 Feb 2019 by Richard Deeming
Try adding constraints to your parameters: routes.MapRoute( name: "Chapter", url: "{chapterID}/{verseNumber}", defaults: new { controller = "Chapter", action = "Index", verseNumber = UrlParameter.Optional }, constraints: new { chapterID = @"\d+", verseNumber = @"\d*" } ); Make...
25 Aug 2019 by Afzaal Ahmad Zeeshan
You are handling that with .NET Core or .NET framework? There are differences in how you might handle the requests and responses in both these frameworks. Since you already have tried something for .NET Core, Quote: which routes he visit This part of your application can be handled within the...