Since ASP.NET 2.0, a check is performed when a page is post back to ensure that all the submitted values are part of the original choices. This would for example prevent someone from spoofing the selection of the item Winter from a list of days. All in all, this is good stuff.
The implementation of this new functionality relies on an hidden field named __EVENTVALIDATION, which is automatically added to the end of our web forms. There are some flaws to this approach, though. In fact, it is possible for a browser to submit a partially received page, for which the validation field has not yet been received. When ASP.NET receives such a post back, it has not basis for comparing the submitted values with the original choices, so it refuses the post back with the "Invalid postback or callback argument" exception.
While waiting for a fix on this functionality :
<script type="text/javascript">
function IsLoaded()
{
return (document.getElementById("__ISLOADED")!=null);
}
</script>
<form onsubmit="javascript: return IsLoaded();">
</form>
<input type="hidden" id="__ISLOADED" value="true" />
Wednesday, August 6, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment