by Dan Matthews
14. September 2007 13:42
If you ever find the need to suppress the ViewState hidden field in ASP.NET, you're in for a world of pain :) There are various blog posts that discuss the issue but none give clean and easy server-side solutions - that is unless you really want to take over the http stream and start tag stripping.
There is a very quick and admittedly dirty client-side way of doing it in DHTML:
<script language="javascript">
document.getElementById('__VIEWSTATE').parentNode.removeChild(document.getElementById('__VIEWSTATE'));
</script>
Yes I know. Yuk. Works in IE6/7 and Firefox tho!
abec6043-d2e4-4d81-8789-9f40ddd91a30|0|.0
Tags:
.NET/C#