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

Does Security Trimming work with Web Forms Routing?

In my web.config I have configured a SiteMapProvider with securityTrimmingEnabled="true" and on my main master page is an asp:Menu control bound to an asp:SiteMapDataSource. In addition I have configured restricted access to all pages in a subfolder…
Slauma
  • 175,098
  • 59
  • 401
  • 420
0
votes
1 answer

Routing Issue want to display domain name even index.aspx is called

routes.MapPageRoute("Main", "", "~/index.aspx"); thats the route I mapped on index page.. when I call the url with index.aspx it displays like www.abc.com/index.aspx but I want it to show www.abc.com even when index.aspx is called
Mike
  • 751
  • 2
  • 10
  • 25
0
votes
0 answers

ASP.Net Breadcrumb Navigation Routing with Url.Action

I'm using ASP.Net 4.5 w/ MVC 5.2.2.0, and trying to add breadcrumb style navigation to an app that has five levels of navigational depth. I got to the fourth level, and noticed a weird problem during testing a proof of concept page. All but the…
Jake Braun
  • 1,172
  • 1
  • 13
  • 34
0
votes
1 answer

Set Default Start Document

This seems pretty simple, but for the life of me I can't figure it out. Using ASP.NET Classic (ie non-MVC), say I have a website www.foo.com that has an /api folder, and in that folder is the file api.aspx (i.e. you hit www.foo.com/api/api.aspx) How…
dlchambers
  • 3,511
  • 3
  • 29
  • 34
0
votes
0 answers

Modify Route Values in MVC to pass in textbox value

I want to pass the value in my textbox 'location' to my route so that my route looks something like this https://localhost:44300/Home/Results/San+Francisco?Day=01%2F28%F2015 right now my url looks like…
chuckd
  • 13,460
  • 29
  • 152
  • 331
0
votes
2 answers

How to route Url with # character in Asp.Net 4?

How to route url contains # sharp character like this: ~/page.aspx#/Home to be: ~/Home
cjinojl
  • 21
  • 2
0
votes
4 answers

Adding MVC4 to Webforms Application - Routing Not Working

I'm trying to add MVC 4 into an existing webforms project. I followed this guide: https://www.packtpub.com/books/content/mixing-aspnet-webforms-and-aspnet-mvc After adding to the web.config:
maembe
  • 1,270
  • 1
  • 13
  • 25
0
votes
0 answers

ASP.NET Web API DELETE method 405 Method Not Allowed

I'm developing a project using asp.net web api in vs 2012. In this project when I want to delete a record from a separated project I get this error message "NetworkError: 405 Method Not Allowed - http://localhost:30777/api/Customer/1". In client…
0
votes
0 answers

MVC 5 application won't process aspx file if RouteExistingFiles = true

I have routes.RouteExistingFiles = true; in RouteConfig.cs in an ASP.NET MVC 5 application. It won't process an aspx file. If I have try to open a URI like "/api/latest/Default.aspx" I get just some XML with these peculiar messages:
Erik
  • 5,355
  • 25
  • 39
0
votes
0 answers

Implement back button in ASP.NET MVC

I am facing issue implementing a back button feature in a ASP.NET MVC application. This is my Home page View, for simplicity let us consider it has a div which has img element and div that renders PartialView2. PartialView2 is a partial view which…
Hulk
  • 97
  • 3
  • 16
0
votes
1 answer

Programmatically create GET route in ASP.NET Web Api

I'm trying to programmatically create a route in ASP.NET Web Api that s config.Routes.MapHttpRoute( name: "test", routeTemplate: "api/foo", defaults: new { controller = "Foo", action = "Test" }, constraints: new { …
ConfusedNoob
  • 9,826
  • 14
  • 64
  • 85
0
votes
1 answer

How can I disable URL routing in ASP.Net WebPages?

Or, if that's impossible for some reason, a simpler question: how can I get the physical directory of the current file from a layout page? this.VirtualPath will refer to the virtual path of the layout file itself, and this.NormalizePath(".") will…
Santiclause
  • 870
  • 1
  • 7
  • 12
0
votes
1 answer

ASP routing vs relative links

I'm trying to implement routing on a simple site using web forms 3.5 SP1. The problem is that the site is using a simple form of CMS, so the user can create html content and add images. Since all the 'articles' in the database are stored with the…
steakoverflow
  • 1,206
  • 2
  • 15
  • 24
0
votes
0 answers

How to MapPageRoute a folder name to a different one?

I'm looking at RouteConfig class or MapPageRoute function adn wonders how do I map the folder name to a different folder name. Let's say "~/rFolder/foo2/foo.css" and I'm using hte "rFolder" code to map route to "~/Webpages/Folder" which will result…
fletchsod
  • 3,560
  • 7
  • 39
  • 65
0
votes
1 answer

Why do you need to specify the controller and action in the default route for the RoutesTable in ASP.NET MVC?

Why do we have to specify the defaults for the default route? This is a normal default route: routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id =…
Benutzer
  • 73
  • 1
  • 9