Collection Form Post Parameters in WebAPI Controller

image.png

There are lots of ways using ASP.NET MVC4 to collection passed in form parameters (POST) to the WebAPI Controller.  I’m not wanting to create a Model, I’m not wanting to get involved with dynamic variables, I just want the values that are posted in.  Say for example, my post looks like the following: To capture both sessionId and trackId, I can have a WebAPI controller in Visual Studio that looks just like this: namespace WebAPI.Api{ public class SessionRpcController : ApiController { [HttpPost] [ActionName("UpdateSessionTrack")] [Authorize(Roles = "admin")] public HttpResponseMessage PostUpdateSessionTrack( FormDataCollection formDataCollection) … Continue Reading

Converting ASP.NET WSP (Web Site Projects) to WAP (Web Application Projects) with VS2012

image_thumb.png

  Background There are quite a few articles written on the differences between WSP’s and WAP’s.  In this article, I will not go into the details but just give you some clean mechanics necessary for converting pages using Visual Studio 2012.  Some of those articles are listed below. http://mitchelsellers.com/blogs/2008/01/02/wap-or-wsp-which-to-use-and-why.aspx http://vishaljoshi.blogspot.com/2009/08/web-application-project-vs-web-site.html http://aspnetresources.com/blog/web_site_vs_web_application_project_wap When I was new to Visual Studio, I did choose WSP projects because it seemed easier. Now that I’ve done quite a bit more with ASP.NET, I much prefer WAP projects.  Actually, I hate WSP projects primarily … Continue Reading

Using Fiddler To Replay an AJAX (xmlhttp) Request

image.png

  The Problem I use to spend a lot of time writing throw away JavaScript code to test AJAX (XMLHttpRequest or Asynchronous JavaScript and XML) type requests to my hosted web services.  that is, on my ASP.NET server, I have services that look like the following (Microsoft ASP.NET MVC projects): [HttpPost] [NoCache] public JsonResult GetEmailByPerson(long addressBookEntryId, string existingEmailDetailIds, int? start, int? limit, bool? emailNotViewed = null, bool? emailNotDeleted = null, bool? forceDataToHtmlBody = false) { Utils.AuthorityLevel userAuthorityLevel = Utils.GetUserAuthorityLevel(); if (userAuthorityLevel == Utils.AuthorityLevel.None) { return Json(new { Message = … Continue Reading

How To Add Paging With a Filter Using Sencha Architect with ExtJS4

image.png

  Sometimes,the simplest things can seem complicated.  Well, in this case, after struggling for a while, it turns out the simplest things can actually be pretty simple.  The application I’m building right now (with Sencha’s ExtJS and ASP.NET) is a simple log viewer.  My server base app uses NLog which does a great job of logging the errors, but the errors are all on my server and I need to see them.  So, hence I need a simple log viewer.  Here is what it looks like once it’s all done.     Notice that we have a toolbar that we can check a box in as well as a field to type some text into.  I’m going to assume that creating the windows, the grid, dropping the toolbars on the page (both paging … Continue Reading

Follow

Get every new post delivered to your Inbox

Join other followers: