Html.ActionLink and HTTP PUT, DELETE verbs
Recently I was developing an ASP.NET MVC application in which I needed to create clickable images that would make it possible to delete items and/or to switch an items state between activated/deactivated. I wanted to solve this by using controller methods that would be decorated with an [HttpDelete] or [HttpPut] attribute (delete and put http verbs). Creating the controller methods was straightforward, but I needed to add some html to my view to have the url submitted/posted with the correct http verb (delete or put). Ideally I would want to use Html.ActionLink for this, but unfortunatelly it doesn't support clickable images (only '<a href=...'), and it also does not support other http verbs then 'get'. I have created an HTML helper class, with some HTML extension methods, to make it easier to add clickable put/delete images to views, which I will describe in this post.
ASP.Net MVC and RegisterClientScriptInclude