I want to build an asp.net 2.0 templated control such that it shows only that part of the template whose key matches with the key of the control.
For example:
<mc:mySwitchingControl id="mycon" key="first">
<templates>
<mc:myControlPart id="part1" key="first">
<asp:Button..../>
.....
</mc:myControlPart>
<mc:myControlPart id="part2" key="second">
<asp:Label..../>
...
</mc:myControlPart>
</templates>
</mc:mySwitchingControl>
Here, mySwitchingControl has its "key" property set to "first", so it will only show <mc:myControlPart id="part1" key="first"> and not <mc:myControlPart id="part2" key="second">. However, when we set the "key" value of mySwitchingControl to "second" then
it should show the other part whose id is part2.
I have built templated control, but can't figure out how to simulate such a control. Please help me out here :)
cyberextra
Member
5 Points
1 Post
Templated Switching Control
Nov 23, 2006 02:25 PM|LINK
I am a new member here saying hi to all !!
I want to build an asp.net 2.0 templated control such that it shows only that part of the template whose key matches with the key of the control.
For example:
<mc:mySwitchingControl id="mycon" key="first">
<templates>
<mc:myControlPart id="part1" key="first">
<asp:Button..../>
.....
</mc:myControlPart>
<mc:myControlPart id="part2" key="second">
<asp:Label..../>
...
</mc:myControlPart>
</templates>
</mc:mySwitchingControl>
Here, mySwitchingControl has its "key" property set to "first", so it will only show <mc:myControlPart id="part1" key="first"> and not <mc:myControlPart id="part2" key="second">. However, when we set the "key" value of mySwitchingControl to "second" then it should show the other part whose id is part2.
I have built templated control, but can't figure out how to simulate such a control. Please help me out here :)