Dynamic Forms and AntiForgeryToken MVC
Posted
by oliver
on Stack Overflow
See other posts from Stack Overflow
or by oliver
Published on 2010-05-03T21:44:16Z
Indexed on
2010/05/03
21:48 UTC
Read the original article
Hit count: 377
Hi ALL,
I want to create dynamic forms on a MVC page that will generate something like this.
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;"
I am just not sure how I can implement the AntiForgeryToken on something like above?!? any helpwould be appreciated
© Stack Overflow or respective owner