Reputation: 355
Normally when creating a server control, you create a collection of controls that get added to the control collection and are then rendered into the HTML. If you need to ensure that the properties of the server control (other than input information) is maintained bewteen postbacks, you use the control state to hold this information.
So, would it be possible to create a server control that has no child controls to be rendered, but does have control state information saved between postbacks?
Upvotes: 0
Views: 75
Reputation: 22462
I see no reason why it shouldn't work.
You should just try it. Make a simple server control that contains a public property where the value is stored in the control state. Then write to that property from your page code and see if the value is kept between postbacks.
Upvotes: 0
Reputation: 6396
You don't even need to render a page with an ASP.NET response, so I don't imagine a rendered control is necessary.
Upvotes: 1