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
2 answers

Redirecting route in ASP.NET WebAPI

This is ok: GlobalConfiguration.Configuration.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{action}", defaults: new { id = System.Web.Http.RouteParameter.Optional }); But I want to redirect…
uzay95
  • 16,052
  • 31
  • 116
  • 182
0
votes
0 answers

asp.net routing error page

Does anyone know what the best way would be to deal with error pages using ASP.NET (not MVC) Routing? I have routing set up and working well, however if I visit a page which does not exist i get the standard 404 error page. I would like to know if…
thatuxguy
  • 2,418
  • 7
  • 30
  • 51
0
votes
1 answer

What do we have to do in order to push configurations like URL route mappings to ASP.NET MVC Views to an XML file?

All: We started off our project using ASP.NET Web Forms. We decided to integrate ASP.NET MVC 4 into our project. We would like to leave the existing .aspx ASP.NET Web Form pages as it is already. It would be too much work effort for now to move the…
crazyTech
  • 1,379
  • 3
  • 32
  • 67
0
votes
1 answer

Page.GetRouteUrl in LayoutTemplate of listview?

I am tried to create table structure with header,body,footer in listview which works fine. But in footer which is in layouttemplate, i tried to add below code which gives error.
CoreLean
  • 2,139
  • 5
  • 24
  • 43
0
votes
1 answer

Route testing with WebApiContrib

I have a WebApi project that I am trying to test. I have a controller - public class UserController : ApiController { public string Get() { return "foo"; } } I need to test the route and I am trying to use WebApiContrib.Testing…
0
votes
1 answer

Custom Route Not Working in ASP.NET

I have been trying to following this http://msdn.microsoft.com/en-us/library/cc668202(v=vs.90).aspx I have created add this to my web.config:
user1477388
  • 20,790
  • 32
  • 144
  • 264
0
votes
3 answers

Routing does not recognize route if space appear in route value as '+' char

I faced the following problem. May be someone found this strange behavior too. I have the following route definition in my global.asax.cs: routes.Add(new Route("/module/{searchTerm}", new RouteValueDictionary { {"controller", "Module"}, {"action",…
0
votes
1 answer

ASP.NET Webform Routing

We are building a products site and are using Routes in ASP.NET WebForms C#. We currently have routes.MapPageRoute("", "{categoryName}", "~/Category.aspx"); routes.MapPageRoute("", "{categoryName}/{subCategoryname}", "~/SubCategory.aspx"); It…
Ravi Ram
  • 24,078
  • 21
  • 82
  • 113
0
votes
1 answer

Using a wildcard in a global.asax MapPageRoute

I would like to be able to use the global.asax file to redirect to a page regardless of what parameters come before a specific reference (the parameters can be ignored). routes.MapPageRoute("ExportToExcel",…
0
votes
1 answer

.net mvc routes with parameter proceeding action

I want to know if this is possible (it seems like it should be) I would like to have a route such as: /events/{id}/addcomment where the {id} is a param to be used to identify the event to add a comment too. I'm aware that I could simple do…
Lazy Coder
  • 1,157
  • 1
  • 8
  • 18
0
votes
2 answers

ASP.NET MVC: Routing issue

So I have this controller action: public ActionResult Categories(int typecode) { // code removed } this route: routes.MapRoute(null, "{controller}/{action}/{typecode}", new { controller = "Search", action = "Categories", } ); and this link…
avb
  • 1,558
  • 1
  • 14
  • 37
0
votes
0 answers

ASP.Net 4.0 Routing issue with path

I am struggling with two issues regarding asp.net webform routing in 4.0 version. First issue is with the path on local server same path works fine for other project & creates path issue in local server. Second issue is routing doesn't work on…
Learning
  • 19,469
  • 39
  • 180
  • 373
0
votes
1 answer

What is wrong with my .net routes?

I have followed a few tutorials online and they all seem to show the same logic for .net routing using ASP.net web forms. When I execute the URL below I get a 404 error. Test.aspx is in the root folder of this…
alockrem
  • 767
  • 3
  • 9
  • 23
0
votes
1 answer

ASP.net 4.0 Routing not working with main domain name

I have a simple routing for my website news section. Routing works fine for almost all URL's like http://www.abc.com/Default.aspx http://www.abc.com/Default.aspx?PageId=3 http://www.abc.com/Latest-News-Details.aspx?PageID=28&NewsID=39 Problem only…
Learning
  • 19,469
  • 39
  • 180
  • 373
0
votes
2 answers

How to configure Azure to use domain name instead of *.azurewebsites.com?

When I go to my domain, it redirects to my Azure subdomain (x.azurewebsites.com). How can I fix this so that my domain doesn't redirect? My config file:
naveen
  • 1,078
  • 1
  • 13
  • 26