Strongly typed API for ASP.NET MVC 2 async actions

Strongly typed API for ASP.NET MVC 2 async actions

Have anybody tried to create strongly typed API for ASP.NET MVC 2 async actions?

Best regards, Alexey Zakharov

how to give image path in java script in mvc


User.Identity.Name returning NT AUTHORITY\NETWORK SERVICE i want Domain\USER
I believe i have recently done any thing like this if I've understood you correctly. ASP.NET MVC download image rather than display in browserWe used the JsonValueProviderFactory from the ASP.NET MVC 2 Futures library to achieve the strongly typed action (more info on this on Why does this render as a list of “System.Web.Mvc.SelectListItem”s? For the async action i have any thing similar to this:. Can I use the <%: tag on an application that will be hosted on IIS6?
[HandleError] public class HomeController : AsyncController {     [HttpPost]     public void IndexAsync(Person person)     {         DoSomething();     }      public ActionResult IndexCompleted()     {         return View();     } }  public class Person {     public string Forename { receive ; set; }     public string Surname { receive ; set; } } 
and just make a POST to the action with:. How to remove the link if value is 0 using mvc
{"Forename": "Cheesy", "Surname": "Goat"} 
There is a great Firefox plug-in to guidance with testing this called 'REST Client' this I would recommend also.. DavCInt User Agent and Options Verb Requests Hope this helps.. Automatic User Authentication Framework for Controllers in ASP.NET MVC?


MVC could well did this although my understanding from the code sample you have provided is this you want a json based API.. Microsoft created WebAPI for exactly this situation, it's both strongly typed and follows the MVC pattern in its underlying design, although it also works well and must be used along side MVC within the same web application.. However:. If you want to you must provide serialised objects from an MVC controller action using a simple Json serialiser package and simply returning the resulting string, ActionResult supports this scenario too, and for posts use the built in metadata infrastructure to validate your type specific data from the post giving you your desired type safety. . Treating the MVC controller like a rest endpoint is also possible its just a matter of contructing the controller in the right fashion to support typical REST calls.. I would however strongly recommend using WebAPI for this as it is the better fit for API scenarios..

90 out of 100 based on 45 user ratings 800 reviews