Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Persist Custom Control Property Between Postbacks After Modified In Callback

Status
Not open for further replies.

ApocY85

Programmer
Dec 20, 2007
36
US
I am somewhat new to ASP.NET and very new to custom controls, so I apologize in advance if my question is ridiculous or hard to understand.

I have a custom control that:
[ul]
[li]Inherits WebControl[/li]
[li]Overrides the Enabled property[/li]
[li]Implements System.Web.UI.ICallbackEventHandler[/li]
[/ul]

All elements of the control work properly except for when the Enabled property is modified during a callback. After the property has been modified during a callback, its value is not persisted through the next postback. I have tinkered around with the SaveControlState, LoadControlState, HiddenFields, SaveAllState, EnableViewState, Session variables, and much more. The only way I have possibly been able to get it to work is with a session variable, which I would like to avoid as I've heard that they are a poor route to take. Is there anything else that I can try or am I doing something silly?

Thank you to anyone who helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top