Sunday, May 20, 2012
Access Viewstate from javascript in ASP.net
1)<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="..." />
var vCode = documents.forms[0]['__VIEWSTATE'].Value;
alert(dateView);
2)var viewState = document.getElementsByName('__VIEWSTATE');
or
var viewState = document.document.getElementById(('__VIEWSTATE')
3)This code explains how to access VIEWSTATE hidden field value from javascript which is in encrypted format. How do we decrypt it? var key_value = ‘<%=ViewState[“Key_Name”] %>’
1)<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="..." />
var vCode = documents.forms[0]['__VIEWSTATE'].Value;
alert(dateView);
2)var viewState = document.getElementsByName('__VIEWSTATE');
or
var viewState = document.document.getElementById(('__VIEWSTATE')
3)This code explains how to access VIEWSTATE hidden field value from javascript which is in encrypted format. How do we decrypt it? var key_value = ‘<%=ViewState[“Key_Name”] %>’
Subscribe to:
Posts (Atom)