Skip to main content

All Questions

Tagged with
0 votes
1 answer
54 views

keeping view name and corresponding controller method name different

I have a controller method named CreatePANApplication but I have created view page for this named as PANApplication. Now when I am trying to call this method from another view page as: // dataTable ...
nischalinn's user avatar
  • 1,175
0 votes
2 answers
75 views

Why is ASP.NET MVC returning multiple types matching a controller?

I'm trying to set up a versioned API using ASP.NET MVC4. Global.asax.cs calls a method in my project WebApiConfig.Register with System.Web.Http.GlobalConfiguration.Configuration. Here's what the code ...
Brian Gradin's user avatar
  • 2,275
2 votes
1 answer
717 views

1. Forward slash in routing parameter

I have a GET end point which will take user name as parameter. Below is the action [Route("user/{userName}")] public User GetUserByName([FromUri] string userName) { // logic here } This is how i ...
Akbar Badhusha's user avatar
0 votes
1 answer
29 views

Routing Fails Strangely And I Can't Seem To Pinpoint The Problem

I have 3 links on my website that are generated like below using url.action() <a href="/ViewAd/421/Honda-Accord-2.4-Executive-Automatic" > <a href="/ViewAd/420/Renault-Sandero-900t-...
ShatterStar's user avatar
0 votes
2 answers
106 views

How to replace string or hide string in url after mapping to controller from view?

I am trying to hide or replace string in the URL after mapping to controller from view. View <a href='@Url.Action("Product", "Index", new { prodID [email protected] })'> Controller ...
don's user avatar
  • 65
0 votes
1 answer
2k views

API route not found

I have an API in my code with a route prefix but when I try to hit it, I get a 404. This is my code: namespace MyProject.Authentication.Controllers { [RoutePrefix("api/user")] public class ...
Erica Stockwell-Alpert's user avatar
1 vote
1 answer
149 views

C# MVC dynamic Route based on config

Is it possible to have a dynamic route name so that route name can be read from a config file? e.g. where someStringReadFromConfig would be populated from a config file. [Route("api/v1/test/"+ ...
Aaron's user avatar
  • 41
-1 votes
1 answer
39 views

how to create custom route in mvc4

i am trying to like this (/User/Index?abc) url in after RedirectToAction How to do it Please suggest me.. RouteConfig.cs routes.MapRoute( name: "Putabc", url: "{tempUrl}/{RegNo}", defaults: ...
Dip Girase's user avatar
1 vote
2 answers
894 views

MVC route is not using default action

In my web api, I have created this controller: public class DistributionGroupController : ApiController { [HttpGet] public ServiceResult Index(string id) { if (id == null) ...
Matt Spinks's user avatar
  • 6,710
2 votes
1 answer
130 views

MVC 4 - issue with routing to non-area controllers

I have a project that I am upgrading from MVC 2 -> MVC 4. During the transition from MVC 2 -> MVC 3, I noticed that some of my hyperlinks broke and were no longer matching the routes as defined ...
awh112's user avatar
  • 1,484
0 votes
0 answers
594 views

Custom routes rendering with Html.BeginRouteForm

I'm using custom route mapping in following way: context.MapRoute( "CustomRoute", "Area/{controller}/{id}", new { controller = "Task", action = "Index", id = UrlParameter....
mbigun's user avatar
  • 1,302
0 votes
2 answers
1k views

Asp.net MVC Routing w/ string parameter

I'm learning asp.net, and can't solve a rather simple problem for a while. Have the RouteConfig.cs file with the following content: public class RouteConfig { public static void RegisterRoutes(...
Joooe's user avatar
  • 57
0 votes
1 answer
63 views

strange behaviour of MVC routing

I was reading How MVC routing work from Routing Basics in ASP.NET MVC. It says Additional URL Parameters other than {controller} and {action} are available to be passed as arguments to the ...
Amit Kumar's user avatar
  • 5,962
0 votes
1 answer
158 views

ASP.NET MVC routing task

I have the following route table: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( ...
Oleg Sh's user avatar
  • 9,011
0 votes
1 answer
425 views

Response.RedirecttoRoute going in loop when use in Global.asax

Here is my Route public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "MyRoute", ...
Mussaib Siddiqui's user avatar

15 30 50 per page
1
2 3 4 5
7