9
votes
1answer
4k views

No type was found that matches the controller named 'User'

I'm trying to navigate to a page which its URL is in the following format: localhost:xxxxx/User/{id}/VerifyEmail?secretKey=xxxxxxxxxxxxxxx I've added a new route in the RouteConfig.cs file and so my ...
3
votes
3answers
2k views

MVC API Routing When Multiple Get Actions Are Present

There seems to be a thousand people asking the same question on stack overflow, but there doesn't seem to be a single solution to this problem. I am going to ask it again... I have an API controller ...
3
votes
2answers
407 views

Is there a way to tell routing that my default action name is equal to the HTTP Action Verb?

I've looked through this document on MSDN and can't come up with the answer. Considering that I have a route defined like this: config.Routes.MapHttpRoute( name: ...
3
votes
1answer
320 views

BeginRouteForm doesn't work with API routes?

I have a form I'm trying to create with relatively simple code: @using (Ajax.BeginRouteForm("DefaultApi", new { controller = "persons" }, new AjaxOptions {HttpMethod = "post", OnSuccess = ...
2
votes
1answer
3k views

ASP.NET MVC Web.Api Routing - Real world example

I have been looking at routing in the Web.Api and looking at various ways of representing endpoints. I came across Instagrams REST endpoints. (which has some lovely documentation) Using the Web.Api ...
2
votes
2answers
145 views

Linking to an MVC Route from Web API inside an in-memory server

I'm having problems testing the generation of MVC Routes from inside Web API. The code works when hit manually, but fails under test as the in-memory instance of Web API is unaware of the MVC routes ...
2
votes
0answers
711 views

MVC 4 Web Api Route 404 issue

I have a plain-vanilla MVC 4 Web Api project created using VS2012. The (/api/Values) works out-of-the-box on the localhost but NOT when deployed on IIS (packages created using the standard ...
1
vote
1answer
163 views

Web api with two get actions

I have a Test controller with the following - public string Get(int id) { return "hi from test " + id; } [HttpGet] public string Search(string ...
1
vote
1answer
265 views

Web api project routing trouble

I have simple web api project (ASP.NET MVC). I need to deploy my project in the sub folder on the IIS. For example: I have site http://TestSite/ and I need to deploy the project to ...
1
vote
1answer
214 views

Can I route a mix of optional and conditionally mandatory parameters in ASP.NET Web Api/MVC

I'm guessing that the answer is to make multiple routes, but our route list is beginning to get long, so I'm looking to see if this can be expressed more elegantly and simply. :) In my current ...
1
vote
0answers
336 views

Links from OWIN hosted WebApi to MVC and vice versa

I want to generate url from mvc view to WebApi controller and from WebApi to MVC action. Normally these methods work perfectly: // mvc to webapi @Url.HttpRouteUrl("DefaultApi", new { controller = ...
1
vote
1answer
1k views

RouteHandler for HttpConfiguration

I stumbled onto an interesting article about RouteHandlers for ASP.Net MVC's WebAPI: http://techbrij.com/separate-web-api-action-mobile-asp-net-mvc In this article, it shows how the same WebAPI ...
0
votes
2answers
2k views

MVC Web API route config - filter controllers in route templates

My WebApiConfig.cs Register method looks like this: public static void Register(HttpConfiguration config) { config.Routes.MapHttpRoute( name: "ClassroomContentApi", routeTemplate: ...
0
votes
2answers
155 views

Three routes for one verb in Web API

I am trying to get the following three routes to work: GET /api/category - list all categories GET /api/category/1 - get details about category 1 GET /api/category/1/questions - get questions from ...
0
votes
1answer
145 views

What is the difference between the way routes are registered with MVC and Web API?

In my MVC and WebAPI application I see two different ways of doing routes. One for MVC which calls RegisterRoutes and passes RouteTable.Routes One for Web API which calls CustomizeConfig and passes ...
0
votes
1answer
393 views

How do you route from an MVC project to an MVC ApiController in another project?

I've been struggling with this problem for at least 4 hours now, trying every solution I could find. My main project is set up with Asp.Net and MVC which works great routing to controllers within the ...
0
votes
2answers
2k views

Web API route mapping to root

I am setting up an ASP.NET MVC 4 Web API to accept requests from a 3rd party server, and I simply can't figure out how to set the route mappings. Assume the 3rd party server expects to get responses ...
0
votes
1answer
982 views

WebAPI MapHttpRoute issue with action parameters of type list and bool

I have a deployment time issue with WebAPI and would be grateful if someone can help. Routes: public static void Register(HttpConfiguration config) { // Web API configuration and ...
0
votes
0answers
15 views

Why does my Web API / REST / Windsor code get routed in this direction?

I probably will not be able to provide enough information/insight for anybody to answer this question absolutely, but I'm hoping, by giving the best overview I can of the dilemma, to get thrown a bone ...
0
votes
1answer
36 views

Why does my action method with default parameters cause a 404?

I've got a WebApi action method that does this: Public Function GetSomething(Id As Integer, Optional SomeValue As Integer = 0) As HttpResponseMessage I have the standard route in place: ...
0
votes
1answer
246 views

'Multiple actions were found' error

I have the following default routes setup for my web api services ... config.Routes.MapHttpRoute( name: "DefaultControllerWithIdAndAction", routeTemplate: "api/{controller}/{id}/{action}", ...
0
votes
1answer
223 views

Posting object in ASP.NET MVC API

I have an MVC application, that contains a web application in a simple mvc 4 project. Moreover I have a Windows application, that is a windows execution of the web application in an other windows ...