Value persists in asp.net webpage page even when view state and control state are disabled
The value persists in the asp.net webpage page even if I disable view state and control state. The watchdog remains in the postback even after I disabled Enableviewstate
as false for that page and disabled the control state by overriding it SavePageStateToPersistenceMedium()
as empty.
/*value is still preserving in asp.net webform page
even if disable view state and control state*/
public class CustomTextBox : TextBox
{
public CustomTextBox()
{
}
//this method is ipostbackdatahandler one
protected override void LoadControlState(object savedState)
{
//doing ntng here means we are not saving anything by this way
}
//this method is ipostbackdatahandler one
protected override void RaisePostDataChangedEvent()
{
}
protected override void AddAttributesToRender(System.Web.UI.HtmlTextWriter writer)
{
//writer.AddStyleAttribute(HtmlTextWriterStyle.BackgroundColor, "Green");
writer.AddStyleAttribute(HtmlTextWriterStyle.Padding, "5px");
base.AddAttributesToRender(writer);
}
}
How can I resolve this situation?
+3
source to share