Suppressing ViewState hidden field

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!

Tags:

.NET/C#

Powered by BlogEngine.NET 1.5.0.7
Theme by Interakting

Interakting

A full service digital agency offering online strategy, design and usability, systems integration and online marketing services that deliver real business benefits and ensure your online objectives are met.

Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar