2
我想創建一個MVC頁面上的動態表單,這將產生這樣的東西。動態表單和AntiForgeryToken MVC
onclick="
var f = document.createElement('form');
f.style.display = 'none';
this.parentNode.appendChild(f);
f.method = 'POST';
f.action = this.href;
var s = document.createElement('input');
s.setAttribute('type', 'hidden');
s.setAttribute('name', 'authenticity_token');
s.setAttribute('value', '6I6td2wJRI9Nu5Au/F3EfOQhxJbEMXabuVXM0nXonkY=');
f.appendChild(s);
f.submit();
return false;"
我只是不確定如何在上面的東西上實現AntiForgeryToken?!? 任何helpwould理解