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

Route is matching on parameter, not action name / View isn't returning properly

I want to create a url like that below: www.mywebapp.com/Users/Profile/john I have the UsersController controller and the Profile action, which returns a ViewResult to the Profile page. I've created a route to manage it: routes.MapRoute( name:…
Kiwanax
  • 1,265
  • 1
  • 22
  • 41
0
votes
1 answer

Why is my Web API routing not working?

I have the following code in my we api: public static void Register(HttpConfiguration config) { // Web API routes config.MapHttpAttributeRoutes(); //Set default content to json var appXmlType =…
Zapnologica
  • 22,170
  • 44
  • 158
  • 253
0
votes
2 answers

Remove additional route parameters for POST submit

I have a route definition using the new MVC5 RouteAttribute that looks like this- [HttpGet] [AllowAnonymous, Route("Account/ResetPassword/{user}/{token}", Name = "ResetPasswordForm")] public async Task ResetPassword(int user, string…
pwdst
  • 13,909
  • 3
  • 34
  • 50
0
votes
1 answer

I can't get the value in Controller from View in ASP.Net MVC4 with Entity Framework

I am new to ASP.Net MVC4 with Entity Framework. I am trying sample rating. The problem is while i am passing the rated value from View to Controller, I am not able to get it. Please help me to get it. Thanks in advance. This is my View…
Vetri
  • 347
  • 2
  • 6
  • 23
0
votes
1 answer

No route in the route table matches the supplied values after RedirectToAction

I have a next routes settings: routes.MapRoute( name: "TestCC", url: "TestCC/{action}", defaults: new { controller = "PaymentHub", action = "Cancelled" } ); …
Arbejdsglæde
  • 13,670
  • 26
  • 78
  • 144
0
votes
0 answers

An error occurred while updating the entries. See the inner exception for details. ASP.NE MVC 4 with Entity Framework

I am trying to insert the value into a database using Entity Framework. It is showing an error: Exception:: An error occurred while updating the entries. See the inner exception for details. Inner Exception: cannot insert explicit value for…
Vetri
  • 77
  • 2
  • 3
  • 10
0
votes
1 answer

(ModelState.IsValid) Property is not working properly in asp.net mvc4 with entity framework

I have tried simple user log in using asp.net mvc4. I have used this condition (ModelState.IsValid), It was workiing before two days. Now i am trying to execute this program, But that property is terminating the condition. Please anyone help me to…
Vetri
  • 77
  • 2
  • 3
  • 10
0
votes
0 answers

An error occurred while updating the entries. See the inner exception for details in asp.net mvc4

While I am trying to insert values into the database in asp.net mvc4 with entity framework, it is throwing an exception. Help me to solve this exception. The error message is: An error occurred while updating the entries. See the inner exception…
Vetri
  • 77
  • 2
  • 3
  • 10
0
votes
1 answer

How to get a rating value in asp.net mvc4?

I am new asp.net mvc4 with entity frame work, I have designed rating in cshtml file,Pls help me to get a rated value in Controller. Thanks in advance. This is my cshtml code for rating { @{ ViewBag.Title = "Index"; }

Index rating

Vetri
  • 77
  • 2
  • 3
  • 10
0
votes
2 answers

Rating in asp.net mvc4 entity framework

I am trying rating in asp.net mvc4 with entity framework, I have tried this code in cshtml but it is not working, please help me to achieve this. Its working while i am running in normal browser but it is not working while integrating into the…
Vetri
  • 77
  • 2
  • 3
  • 10
0
votes
1 answer

How to pass the value back?

Pls help me.. This is my code for login, I am going to store the value of user name and role id in session,,This is returning only bool value,,How to pass the value back of session of role id ? { public ActionResult…
Vetri
  • 77
  • 2
  • 3
  • 10
0
votes
1 answer

How to get a installed package in view in asp.net mvc4?

I am new to asp.net mvc4, I already installed the Capchamvc4 package in asp.net mvc4 framework. How to get that installed package in the view page, pls help me. Thanks in advance.
Vetri
  • 77
  • 2
  • 3
  • 10
0
votes
0 answers

How to restrict access to a folder with routing rules?

I want to resctrict access to folder called Authenticated by adding this rule to the root Web.config
Karine
  • 385
  • 1
  • 7
  • 18
0
votes
1 answer

redirect to specific route on datapager page index change

I have a listing page which contains a ListView control associated to DataPager control. I have also implemented ASP.Net WebForms URL routing. initially when the user visits the page the url comes like www.domain.com/entity/list When i click on…
Devjosh
  • 6,450
  • 4
  • 39
  • 61
0
votes
3 answers

ASP.NET route passing string value

I'm trying to have a page on an ASP.NET MVC based web site where one page allows selecting by username instead of ID. I would have thought the route needs to be something like: routes.MapRoute( "CustomerView", "Customer/Details/{username}", new…
nathanchere
  • 8,008
  • 15
  • 65
  • 86