Questions tagged [asp.net-routing]

ASP.NET routing enables you to use URLs that do not have to map to specific files in a Web site in both ASP.NET MVC and ASP.NET Webforms.

ASP.NET routing enables you to use URLs that do not have to map to specific files in a Web site. Because the URL does not have to map to a file, you can use URLs that are descriptive of the user's action and therefore are more easily understood by users.

You can define URL patterns that map to request-handler files, but that do not necessarily include the names of those files in the URL. In addition, you can include placeholders in a URL pattern so that variable data can be passed to the request handler without requiring a query string. This topic requires an understanding of ASP.Net Routing and its design logic.

Adding Routes to Webforms

Adding Routes to an MVC Application

399 questions
0
votes
1 answer

ASP.NET Routing block asp.net menu control from showing horizntal sub menus

I am working on a project which is complete & while testing & found that ASP.NET Routing blocks menu from showing up on pages with friendly URL (ASP.Net 4.0, C#) Routing Code routes.MapPageRoute("ActivityRoute",…
Learning
  • 19,469
  • 39
  • 180
  • 373
0
votes
1 answer

Asp.net Route /something/{any url} to /{any url}

This thing is driving me mad: browser url -------> phisical path http://somedomain/routeName ----> ~/Default.aspx WORKS http://somedomain/routeName/anypage.aspx ----> ~/anypage.aspx WORKS http://somedomain/routeName/anyfolder ---->…
giammin
  • 18,620
  • 8
  • 71
  • 89
0
votes
2 answers

webapi action overload

here are my actions public AddressModel[] Get() { return addresses.ToArray(); } public AddressModel Get([FromUri]GetAddressModelById model) { return Addresses.FirstOrDefault(x => x.Id == model.Id); } ... public class GetAddressModelById { …
Jason Meckley
  • 7,589
  • 1
  • 24
  • 45
0
votes
2 answers

Routing for action on default controller in ASP.NET MVC

I have a default routing so if I go to www.domain.com/app/ it's, for example, the HomeController. I have another action on the control, e.g. helloworld but if I go to www.domain.com/app/helloworld it fails with a 404 (expecting helloworld controller…
DaveO
  • 1,909
  • 4
  • 33
  • 63
0
votes
2 answers

WebAPI GET optional integer parameters

Can someone help me fill in the blanks with my GET methods for webapi. I want to pass in no parameters and get all results. Pass in an int and get a single result and pass in a named parameter to filter by a typeId / zoneId or both but am…
PMC
  • 4,698
  • 3
  • 37
  • 57
0
votes
1 answer

Advice on Large Number of Routes

In our RouteConfig in an effort to have company profiles names as the some of our root URLs, we are adding a route for each company name, eg. xyz.com/acme Whilst this appears to be working ok, I was hoping for some general advice on this, or a…
Nick Howard
  • 943
  • 1
  • 13
  • 25
0
votes
1 answer

Sitecore Custom Routing (Not MVC)

I followed this post and this in order to test create a custom routing entry for an item. I tried to register a route in global.asax something like this... void RegisterRoutes(RouteCollection routes) { routes.RouteExistingFiles =…
xoail
  • 2,978
  • 5
  • 36
  • 70
0
votes
1 answer

Regarding Routing in Global.asax in asp.net 4.0

Hey guys I am struck with how to do customize routing from our .cs page I know that we can do routing in global.asax using routeCollection.MapPageRoute("Default Page", "Default/{ProductName}/{CategoryName}", "~/Default.aspx"); But i want to do…
0
votes
1 answer

asp.net 4.0 - routing root pages and validator controls issue

I am simplifying my question: When I route all my .aspx pages on my web app root the following way in global.asax: routes.MapPageRoute("RootPages", "{file}", "~/{file}.aspx"); it all works fine as far as the routing goes, but none of my…
0
votes
1 answer

How to have same URL for different web applications

I have a project that contains 2 web application and I want to use same URL to access the two application 1) admin site used by company : appcompany.com a web forms application 2) general site used by company's customers :…
codingbiz
  • 26,179
  • 8
  • 59
  • 96
0
votes
2 answers

Resolving common routes within core of app using structuremap IoC

We've embarked on the mission of doing a Mvc3 implementation of our framework sites, currently with our existing WebForms implementation. This task has allowed us to integrate IoC and DI with Structuremap for flexibility. To give you some…
Pedro Costa
  • 2,968
  • 2
  • 18
  • 30
0
votes
1 answer

In WCF how do I remove the 404 response body?

I have a WCF service configured and I'm using routing to configure it. Everything is working the way I want it, except the 404 messages have a body stating Service Endpoint not found. I'd like the 404 to have an empty response body. Here is my route…
David Silva Smith
  • 11,498
  • 11
  • 67
  • 91
-1
votes
1 answer

.NET Core API redirect to 404 in startup configuration

I have quite tricky challenge to do, my app is going to have 3 different startup options. So 1 application that is differently hosted/has different use cases/routing. This is a design that we have to follow so cannot change that. So now I need to…
trinny
  • 222
  • 1
  • 5
  • 22
-1
votes
1 answer

Configurable route prefix for controller

I'm using ASP.NET Core 6 and trying to have the base path of my API controller be configurable (so that users can choose the base path themselves to avoid conflicts with other controllers). I tried setting up the following route: string…
TheHvidsten
  • 4,028
  • 3
  • 29
  • 62
-1
votes
1 answer

ASP.NET MVC 5 Traditional Routing

When I debug it, the Product and Subcategory link works fine, however the Category shows me the list but when I click on one of them to show me the products inside each one, does not display anything. Here is my ProductsController.cs. public…
RochaCarter07
  • 97
  • 1
  • 12
1 2 3
26
27