English 中文(简体)
Html使用DELETE形式方法。 BeginForm()?
原标题:Use DELETE form method in Html.BeginForm()?

我愿尽可能使用适当的吉大港山区办法。 在此情况下,当一个纽芬兰被点击去删除一些东西时,我想用属性<代码>[HttpDelete]向控制者采取行动。 然而,我似乎无法用这种方法形成一种形式,即使用拉扎尔辛塔克斯。 <>FormMethod enum>没有选择Delete,并且做以下工作:

@using (Html.BeginForm("Order", "Users", FormMethod.Post, new { method = "DELETE" }))

寻求解决办法没有结果,没有人这样做? 我知道,我只能使用POST,但是,从这个角度来说,吉大港湾中心删除方法的这个点要开始吗?

最佳回答

阁下:

@using (Html.BeginForm("Order", "Users"){ 
   @Html.HttpMethodOverride(HttpVerbs.Delete)
}
问题回答

暂无回答




相关问题
How to update shared view adminheader.cshtml from a model

I ve added a drop down into my shared adminheader.cshtl view and it needs to be dynamically updated from data from a table. So when I use another view like routeplan.cshtml I load the view from ...

ASP.NET MVC Razor view engine

After reading Scott Guthrie s blog entry about the new Razor view engine for ASP.NET MVC and reading this question comparing the available view engines. Razor seems to address most of the problems ...

Client Id for Property (ASP.Net MVC)

I m trying to do a label for a TextBox in my View and I d like to know, how can I take a Id that will be render in client to generate scripts... for example: <label for="<%=x.Name.ClientId%>"...

Get Current Area Name in View or Controller

How do you get the current area name in the view or controller? Is there anything like ViewContext.RouteData.Values["controller"] for areas?

MVC which submit button has been pressed

I have two buttons on my MVC form: <input name="submit" type="submit" id="submit" value="Save" /> <input name="process" type="submit" id="process" value="Process" /> From my Controller ...

热门标签