Completely remove ViewState for specific pages

后端 未结 8 1118
终归单人心
终归单人心 2020-12-06 16:14

I have a site that features some pages which do not require any post-back functionality. They simply display static HTML and don\'t even have any associated code. H

8条回答
  •  死守一世寂寞
    2020-12-06 16:57

    ViewState is added only if an asp:Form is present in the page. Remove the Form, and the hidden field will not be rendered.

    Beware: By doing this, you are also renouncing to have server-side event handlers, or any kind of PostBack events.

提交回复
热议问题