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 MapPageRoute and Folder Path

I have, in Application_Start of global.asax routes.MapPageRoute("Route2", "public/{folder2}/{folder1}/{page}", "~/userpage.aspx", true); routes.MapPageRoute("Route1", "public/{folder1}/{page}", "~/userpage.aspx", true); …
Ugo.m
  • 3
  • 1
  • 3
0
votes
1 answer

Routing Needs to Ignore content from a folder called "ClientBin" which is absolute Physical path on Server so that it Won't get routed ASP.NET MVC

We have a Silverlight 4 Component that gets loaded with content from a folder called "ClientBin" by referring to absolute Physical paths on the Server like the following: C:\SomethingWebApplication\ClientBin\Uploads\carimage.jpg We want The Routing…
crazyTech
  • 1,379
  • 3
  • 32
  • 67
0
votes
1 answer

Web API route for different parameter types

Trying to get my head around Web API routing. I have the following two controllers which have different methods/actions public class MerchantController : ApiController { [HttpGet] [ActionName("GetSuggestedMerchants")] …
Dan Cook
  • 1,935
  • 7
  • 26
  • 50
0
votes
1 answer

Why are these routes being matched?

The following code:
  • @Html.ActionLink(metaTapp.Nav_About, "Mayla", "About")
  • @Html.ActionLink(metaTapp.Nav_Support, "Support", "About")
  • rism
    • 11,932
    • 16
    • 76
    • 116
    0
    votes
    1 answer

    ASP.NET Web API Action Routing

    After a lengthy discussion in terms of how our API would need to behave due to limitations of the backend design, I'd like to have the following possibilities: 1. /students/251/employment <--- allow GET, PUT, POST 2. /students/251/employment/jobs…
    Adam Levitt
    • 10,316
    • 26
    • 84
    • 145
    0
    votes
    1 answer

    ASP.NET Routing all Pages

    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…
    Jack
    • 950
    • 2
    • 17
    • 36
    0
    votes
    1 answer

    ASP.NET FriendlyUrls API - Customising what is classed as a mobile device

    Thanks to an awesome article by Scott Hanselman I managed to implement Microsoft.AspNet.FriendlyUrls in relatively quick time. One thing I'm struggling with is where I can customise what is classed as a mobile device. Has anyone had any success with…
    Darthtong
    • 1,017
    • 4
    • 18
    • 30
    0
    votes
    1 answer

    How to make SEO friendly extensionless urls dynamically in ASP.NET 4.0 webforms

    First of all i apologize if this question is already asked, but i am unable to find any solution for my problem. I am working on a ASP.NET 4.0 Wepforms website in which admin will upload a picture and it will be considered as a post, like a pictures…
    Shaminder Singh
    • 1,283
    • 2
    • 18
    • 31
    0
    votes
    1 answer

    Is it possible to add routes other that Application_start Event in asp.net web forms

    I have dynamic menus which are created by my clients. I have registered my routes at Application_Start event in global.asax. Now i want to register routes when my clients add new menus. How can i achieve this? Currently I have registered all old…
    angfreak
    • 993
    • 2
    • 11
    • 27
    0
    votes
    2 answers

    ASP.NET MVC 4 routing friendly URL

    I found this website have nice URLs. But I don't know how to create routes like that. My format is like: www.domain.com/{country}/{category-name} ---> www.domain.com/japanese/restaurant www.domain.com/{country}/{restaurant-name} --->…
    Jeph
    • 3
    • 1
    • 3
    0
    votes
    1 answer

    routing in asp.net with html page

    i have a about.html page in my application. i want to give this page routing for that i use this code in global file RouteTable.Routes.MapPageRoute("AboutUs", "aboutus", "~/about.html"); but it gives me error like There is no build provider…
    Hardik Mer
    • 824
    • 4
    • 14
    • 26
    0
    votes
    1 answer

    Asp.net mvc url routing. Change url

    My controller is "/Home/Index".I want, when i type url to "/Dashboard/Index" or "example.com/Dashboard" my "/Home/Index action method" executed. Can you give me starting point?
    0
    votes
    1 answer

    Would it be possible to use URL routing for the following purpose?

    I have a site that is being converted from classic asp to asp.net webforms. The old version of the website maintained to separate versions of the site, one for the US and one for Canada. The US version sat at the root of the domain and the Canadian…
    David
    • 19,389
    • 12
    • 63
    • 87
    0
    votes
    1 answer

    How to route from a area to the default route

    I have a front page and a CMS area with the following routes: Default Front Page route routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional…
    0
    votes
    0 answers

    ASP.NET URL routing - Page.GetRouteUrl vs hard coding the URL

    Is there any difference between: lit1.Text = "View"; and: View I use the two ways interchangeably depending on what…
    notAnonymousAnymore
    • 2,637
    • 9
    • 49
    • 74