Click here to Skip to main content
15,890,690 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 Updated

Routing 

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...
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...
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...
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...
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 Nov 2013 by Amey K Bhatkar
Routing in ASP.NET MVC Tutorial for beginners
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 aref.bozorgmehr
ok mamnoonmoshkelam roo tozih dadam age komak konid mamnoon misham
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
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...
7 Jun 2015 by aspdotnetkhan
Hi,This below code snippet working with SQL query i wrote in code behind.' NavigateUrl=''> ...
25 Aug 2019 by Benktesh Sharma
One option that can be used to automatically log those request/response is via middleware in .Net Core. An example implementation is available at Using Middleware to Log Requests and Responses in ASP.NET Core - Exception Not Found[^] .
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[^]
9 Feb 2017 by cgprakash
I came across an error on getting the url meta data by using Angular JS with ajax. The error statement is:XMLHttpRequest cannot load http://www.esample.com/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.var...
8 Feb 2017 by cgprakash
But i have tried on my own web page its not restricted to get those details when I tried the same with php I got those details by curl functions.
6 Nov 2013 by CPallini
This is a pretty specialized task. I think you could find better help on the very dd-wrt website[^].
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...
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
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:...
6 Dec 2019 by Devrim Altınkurt
All routing examples are using with '/' character for example: /{category}/{product}/{id} /computer/mainboard/13 is it possible use a comma ',' instead of '/' for example: /{category},{product},{id} /computer,mainboard,13 thanks What I have tried: in startup.cs public void...
13 Nov 2018 by Dheerajs975
i have created one project and implemented Angular routing in it, but i am getting the below errors. do anyone have any suggestions abou why these errors occuers. Error: [$rootScope:infdig] http://errors.angularjs.org/1.2.16/$rootScope/infdig? What I have tried: i have tried this below...
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...
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) { ...
29 Apr 2016 by EasyHero
hi, i noticed that when i view my html pagesource i see my javascript references and when i click on them, i could see all my javascript code. please how to i restrict users from viewing my javascript code when they click on the link in the page source. i'm coding with mvc5.What I have...
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...
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...
20 Mar 2014 by Er. Ajay Chauhan
According to me, you can find this functionality in MVC application.
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...
13 Sep 2015 by F-ES Sitecore
You can use the FormCollection to process the post dynamicallyGetting Data From View to Controller in MVC[^]
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.
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...
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...
29 Jul 2013 by freakyit
hi,just an idea:do you have activated port forwording to your ip-address ?greetz
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
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...
10 Feb 2015 by harsimranb
An angular application that consumes GitHub, primarily to demonstrate the use of angular-loading-bar and ui-router to give better feedback during longer requests.
6 Nov 2013 by Houssem_Dellai
Creating a Web API service that gets tweets and hosting it on Windows Azure.
13 May 2013 by imastu
My JavaScript is not working when i implement URL Routing in my asp.net application.....There is problem of path ...the source path i am adding in the head section of the page is recognized by the Browser....If anybody know how to solve this problem please help me........Here is some...
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...
31 Jan 2022 by Jamil Hallal
I would suggest to use URL Rewrite in IIS, this can be done in the web.config
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...
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" ...
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 ->...
9 Aug 2015 by jyoti mahalik
Hi,I have implemented ARR reverse routing in IIS 8.5 ...
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...
29 Jul 2013 by Klockness
I have several LANs(10.0.0.x) connected to a WAN(192.168.1.x). Each through a router that allows a network drirected broadcast. This is to allow the devices in the LANs to be discovered by devices on the WAN. I can send a broadcast on the LAN(10.0.0.255) and receive it on my socket. But when I...
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...
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" })
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) ...
3 Aug 2017 by Kornfeld Eliyahu Peter
"Survey/Language{languageName}...
5 Jul 2018 by Kornfeld Eliyahu Peter
The order of routing rules is matter... The look for the rule will stop on the first fit... In most cases that means that longer rules (with the same opening) should come before the short one... So switch between your two rules...
31 Jul 2021 by kowsalya salem
In my Website I'm integrated with firebase real time database and fire store Document Database, It Loading large amount of data for analysis same by default on every page view. if some one intently Programmatically creating Multiple time of...
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",...
26 Nov 2019 by Krishnananthan Vijayaretnam
Currently I'm working on an asp.net mvc project. I have done an attribute routing and it's working well. The code is given below. Now I'm thinking of keeping the Route values on a table and set it to relevant actions. For example currently for the action TestOne I've set "Test_Test_One" as a...
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", ...
5 Jul 2018 by kuyucakli
Hi. I have a problem with rouing in asp.net mvc. How can i redirect : 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"}...
13 May 2013 by LolaFile
The routes wasn't being registered properly. Deleted the global.asax file and added it again and the code worked.
13 May 2013 by LolaFile
I have added this code to my global.asaxvoid Application_Start(object sender, EventArgs e) { // Code that runs on application startup RegisterRoutes(RouteTable.Routes); }.........void RegisterRoutes(RouteCollection routes) { ...
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...:(
11 Sep 2012 by mamali
salam , moshkelet o farsi ham begi inja kheili irani hast negaran nabash
16 Jun 2018 by Mehdi Gholam
Read the following : Authenticate with OAuth 2.0 in ASP.NET Core 2.0 • Jerrie Pelser's Blog[^]
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...
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...
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") ...
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...
2 Dec 2015 by Member 11545705
I am using autocomplete extender for getting suggestions in .aspx page it was working fine and when i have routed the URL it was not working properly and some times it's not responding.In the routed url all html content is displaying letter by letter Suggestions what iam getting in routed...
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...
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 =...
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...
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...
12 Jul 2018 by Member 13909437
Did you ever find a solution? I have the same issue right now.
19 Sep 2022 by Member 15064765
I am migrating a project which contains hundreds of static htm files all of which need to be routed to new dynamic Blazor pages. This website is decades old and has many hundreds (if not thousands) of backlinks that should not be sacrificed with...
19 Sep 2022 by Member 15064765
Just figured it out! Adding this endpoint to my Startup.cs gives me access to everything I need: endpoints.MapFallbackToPage("/{param?}", "/_Host"); For those that are 100% new, here is a more complete code snippet: ...
13 Sep 2015 by Member 9683318
Hi, Below is my business scenario and I am trying to identify the best possible solution to address itBusiness ProblemI have an upstream system which invokes my MVC application. The parameters are passed through a HttpPost rather than parameterized URL.Possible Solution ?1)...
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...
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.
5 Jan 2016 by Mohsen.srn
I am trying to make my websites urls more SEO friendly, so I Used This approach to change routing.(although I dont know is this approach is Best Way or not - but this is not my Question!)public static void RegisterRoutes(RouteCollection routes) { ...
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...
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
20 Mar 2014 by mrityunjay3601
I Have one page Default.aspx , i want to pass Query string with the url.But i want URL should come in a appropriate format.protected void lnkForward_Click(object sender, EventArgs e) { try { string UserName=Session["UserName"].ToString(); string...
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
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 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/[^]
26 Jun 2020 by OriginalGriff
I suggest you talk to your classmate: How can I send numbers to a specific buffer every time[^] And I'll give you the same answer: Quote: We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all...
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, ...
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
26 Jun 2020 by Patrice T
You do not even asked a question. You show no attempt to solve the problem yourself, your main effort is pasting the requirement, you just want us to do your HomeWork. We do not do your HomeWork. HomeWork is not set to test your skills at...
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 (~).
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...
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...
23 Jul 2015 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
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...