c# - MVC 5 @Html.AntiForgeryToken() generating html tag with empty value -
title pretty self-explanatory. helper razor tag generating token cookie way supposed to, not correct hidden tag. checked syntax, forms aren't using ajax, , cookie apparently correct, so...
i'd rather take chances of having question marked duplicate spending weeks on needle in haystack kind of issue.
view:
@model model @{ viewbag.title = "title"; } @using (html.beginform()) { @html.antiforgerytoken() //content }
controller:
[httppost] [validateantiforgerytoken] public actionresult controllername([bind(include = "fields")] class objectclass) { //content }
tag:
<input name="__requestverificationtoken" type="hidden" value="">
cookie:
name,value,domain,path,expires,httponly,secure __requestverificationtoken,5irf4kpqpupqnqrnlt74yrs99moxw7y-wcjkfoz3gmh3dmtuqpehhajm8vqzg9z7p7f3rymz2zojemqwjp0meq2etandi5rm9n0rt7jjqce1,localhost,/,sessão,true,false
update 1:
turns out happening because of jquery. suspecting due incompatibility version installed, 3.1.1, latest stable one. has following condition around lines 7958-7961 forcefully removing element attribute:
// if set returns undefined, fall normal setting if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { this.value = val; }
but in end found condition has been around ever since v1, debugging client code, still remains mistery why happens exclusively in project. anyway, feedback.
Comments
Post a Comment