Depending on what functionality you need. You can disable viewstate on a "per
control" basis by setting controlname.EnableViewState = false
If you would just like the postback functionality for a form you can override
viewstate all together.
Then you don't even need to user a server side form.
NOTE: this has odd side effects. Like HtmlInputImages cannot raise the
ServerClick event.
C# code
protected override object LoadPageStateFromPersistenceMedium()
{
return null;
}
protected override NameValueCollection DeterminePostBackMode()
{
if(Request.Form.Count > 0)
{
return Request.Form;
}
return null;
}
protected override void SavePageStateToPersistenceMedium(object viewState)
{
// Do nothing.
}