﻿using System.Web.Mvc;

namespace RestfulRouting
{
    public static class HtmlHelperExtensions
    {
        public static MvcHtmlString PutOverrideTag(this HtmlHelper html)
        {
            return MvcHtmlString.Create("<input type=\"hidden\" name=\"_method\" value=\"put\" />");
        }

        public static MvcHtmlString DeleteOverrideTag(this HtmlHelper html)
        {
            return MvcHtmlString.Create("<input type=\"hidden\" name=\"_method\" value=\"delete\" />");
        }
    }
}



﻿using System.Web.Mvc;
using System.Web.Mvc.Html;

namespace RestfulRouting
{
    public static class HtmlHelperExtensions
    {
        public static MvcHtmlString PutOverrideTag(this HtmlHelper html)
        {
            return html.Hidden("_method", "put");
        }

        public static MvcHtmlString DeleteOverrideTag(this HtmlHelper html)
        {
            return html.Hidden("_method", "delete");
        }
    }
}



Use HTML helper extension method for outputting an <input type="hidden"/> element
Use HTML helper extension method for outputting an <input type="hidden"/> element
