Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

How to add antiforgery token for AJAX call in MVC application

$
0
0

I'm trying mitigate CSRF issues for MVC application but facing issues while adding anti forgery token in following code in cshtml. Tried searching around but no concrete solution found.

Would appreciate any help..

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


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>