Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Viewstate in webcontrol
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00881815
Message ID:
00881856
Views:
16
>Hi Guys,
>I have created a calendar web control. The control has a text box and image. It works fine but when I click the submit button the control becomes empty even if there is a value in it before submitting. I need the control to retain the value like the textbox control. Can anyone help ?

If you build custom controls you need to manually do this in the control's code. Usually you can hook OnLoad() to pick up any incoming data and assign it to your internal controls (using good old Request.Form[]) and SaveViewState() (if you need to write out viewstate for the control) when you're done.

There are more fine grained interfaces you can implement (IPostbackHandler for example), but in situations where the control has just one child control this is overkill...
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform