用.Ajax替换Ajax.ActionLink吗?包括标题值

时间:2019-06-14 21:25:08

标签: asp.net-mvc asp.net-ajax

需要添加数据/标头值以包含Antiforgery令牌,因此要在ActionLink下面用.Ajax替换。 请您帮忙?

 @Ajax.ActionLink(
                                                "Delete","DeleteStudent","RqstProcessor",
                                                new
                                                {                                                    
                                                    id = current.key
                                                },
                                                new AjaxOptions
                                                {
                                                    AllowCache = false,                                                    
                                                    HttpMethod = "POST",
                                                    UpdateTargetId = "StudentList",
                                                    InsertionMode = InsertionMode.Replace,
                                                },
                                                new
                                                {
                                                    @class = "ignoreClick"
                                                }
                                             )

0 个答案:

没有答案