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
-1
votes
1 answer

How to cut "/Default.aspx" from URL

Routes are working, but when i start my site up i get localhost:57564/Default.aspx Is there a simple fix for this?
Homme
  • 23
  • 8
-1
votes
1 answer

ASP.NET MVC Routing Failure

I have an ASP.NET MVC application where I have activated WEB API 2 routing. When the application launches with the default url the default action is not being called. I am getting the following message: "Message": "The requested resource does not…
Peter
  • 173
  • 12
-1
votes
1 answer

How to pass multiple params to WebAPI?

I have the following URL: http://localhost/api/values/100/some+string+here In the WebAPI app ValuesController, I have this: [HttpGet] [Route("api/values/{p1}/{p2}")] public HttpResponseMessage Get (string p1, string p2) { ... } For the caller, it…
4thSpace
  • 43,672
  • 97
  • 296
  • 475
-1
votes
1 answer

How do I change the route of an ASP.NET MVC controller?

I have a typical ASP.NET MVC controller, but I just want to change its route. The default route now is: Blog/{controller}/{action}/{id} I want to change the route of a specific controller to Blog/Admin/{controller}/{action}/{id}" I tried to…
Yulian
  • 6,262
  • 10
  • 65
  • 92
-1
votes
3 answers

MVC routing issue to make two methods work

I have product controller and two methods edit and fileupload. what should I do in my route config to make these two work. Product/6 (for editing productid 6) Product/Fileupload (for uploading file). my current route in routeconfig is as follows: …
Learner
  • 1,277
  • 3
  • 15
  • 34
-1
votes
2 answers

Automatically preserving "id" argument across different actions on the same controller in ASP.NET MVC

My goal is for all methods of my CompanyController to share the same "id" parameter without having to explicitly pass it via RouteValueDictionary, as that is cluttersome and error-prone. So for example, If I am on a page…
DenNukem
  • 8,014
  • 3
  • 40
  • 45
-2
votes
1 answer

ASP.Net Routing - collection was modified enumeration operation may not execute

I got error randomly on the site as per below error image. I have used just for loop to add Route to RouteTable and I have clear Routes before alter Route collection. RouteTable.Routes.Clear() For i As Integer = 0 To ds.Tables(0).Rows.Count - 1 …
Vimal Usadadiya
  • 39
  • 1
  • 1
  • 5
-2
votes
1 answer

How do I pass the value to Controller from View without Creating any Object for Model in View in ASP.NET MVC4?

I am new to ASP.NET MVC4 With Entity Framework. I just want to pass the value from View to Controller, I am unable to get it. Please help me to get it. Thanks in advance. This is my View code:
Vetri
  • 347
  • 2
  • 6
  • 23
-6
votes
1 answer

rewrite url. asp.net c#

how to rewrite url string. in asp.net with c#.net.
AjmeraInfo
  • 506
  • 3
  • 10
  • 25
1 2 3
26
27