Lagnajeet Sahu 0 Newbie Poster

I have come across a requirement to dynamically show or hide asp.net web controls , html server controls. I want to do this through a configuration XML. So each page /aspx will have a configuration xml.

Would it be possible to create a control (may be a custom control , to which i can attach the xml file). The control (lets says sequencer) should decide which control should be ordered in which place and if the control has to be shown or not.

Some thing like this

aspx -

<Sequencer XmlPath=".." Id=".." Runat="server">

<Textbox id="t1" runat="server" />
<Textbox id="t2" runat="server" />
<Textbox id="t3" runat="server" />

</Sequencer>

xml config -

<Sequencer Id="S1">
<control id="t1" sequence="2" show="true" />
<control id="t2" sequence="1" show="true" />
<control id="t3" sequence="3" show="false" />
</Sequencer>

So in this case t2 should be rendered first then t1. t3 should not be rendered at all on the screen.

Which page event should I use in this case?

Can some one suggest how I can create this kind of a custom control that does the above for me.