In a .Net MVC3 web application, how can I get the AntiForgeryToken? The HtmlHelper.AntiForgeryToken() returns the token wrapped by a hidden field, but I just want the token. Is there an option to retrieve only the value?
This is for a piece of javascript which does a POST to a url (without form).
Not really. It comes out of System.Web.Helpers that way. The actual implementation of the token is in an internal class.
On the other hand, your JavaScript can read the value of a hidden field, with or without a form.