User2111504239 posted
Hi,
I'm creating a composite control which should be called from aspx/ascx like the following:
<ws:ExtendedLabel ID="lab_name" Text="Name" PopupText="Enter your name here" runat="server"
IsMandatory="true">
<asp:TextBox ID="tb_name" runat="server" Text="" />
</ws:ExtendedLabel>
So, the Label should be rendered, together with an mandatory-sign and small tooltip popping up when mouseover is active. Additionally, the TextBox should be associated to the label and rendered.
For that I created a UserControl, derived from Label. I use the [ParseChildren(false)]-Property.
In CreateChildControls() I add the Link for the tooltip-layer and the tooltip itself. I also override the RenderChildren-function to add some html before/after rendering the textbox.
This works fine, even after Postback everything works as espected.
If I want to use a DropDownList instead of a TextBox, the DropDownList loses their items. After some websearch I think this is a viewstate-problem, but I don't know how to solve it.
Any help?
I tried to describe the problem and didn't posted the complete source-code to leave this post slim.
Cheers, kalle.