Logo 
Search:

Asp.net Answers

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds
  Question Asked By: Anpu Massri   on Jun 13 In Asp.net Category.

  
Question Answered By: Ella Brown   on Jun 13

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.
}

Share: 

 

This Question has 11 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Viewstate Or get search suggestion and latest updates.


Tagged: