ASP.net MVC AntiForgeryToken over AJAX

前端 未结 6 1906
清酒与你
清酒与你 2020-12-10 16:08

I am currently developing an MVC application in ASP.net. I am using AJAX.ActionLink to provide a delete link in a list of records, however this is very insecure. I have put

6条回答
  •  甜味超标
    2020-12-10 16:26

    I don't know about the AJAX ActionLink specifically, but it is possible from a WebForms page to post to an MVC action with the [AcceptVerbs(HttpVerbs.Post), ValidateAntiForgeryToken] attributes.

    You can use reflection to get at the MVC methods used to set the cookie and matching form input used for the MVC validation.

    See this answer: Using an MVC HtmlHelper from a WebForm

提交回复
热议问题