J
John Knoop
Hi all!
I would like to create a user control that handles an unlimited amount of
templates. I suppose I would like to define the templates kind of like this:
<mycontrol datakeyfield="model" id="ctl" runat="server">
<template key="Ferrari">
<h1><%# Container.DataItem("model") %></h1><br>
<font color="red">Some text</font>
</template>
<template key="Jaguar">
<h1><%# Container.DataItem("model") %></h1><br>
<font color="black">Some text</font>
</template>
<template key="Lamborghini">
<h1><%# Container.DataItem("model") %></h1><br>
<font color="blue">Some text</font>
</template>
</mycontrol>
How do I achieve this? I've tried to declare the Template property of the
usercontrol like this:
<TemplateContainer(GetType(MegaItem))> public Property Template(key as
object) As ITemplate
....but I can't seem to solve it.
Please help
/john
I would like to create a user control that handles an unlimited amount of
templates. I suppose I would like to define the templates kind of like this:
<mycontrol datakeyfield="model" id="ctl" runat="server">
<template key="Ferrari">
<h1><%# Container.DataItem("model") %></h1><br>
<font color="red">Some text</font>
</template>
<template key="Jaguar">
<h1><%# Container.DataItem("model") %></h1><br>
<font color="black">Some text</font>
</template>
<template key="Lamborghini">
<h1><%# Container.DataItem("model") %></h1><br>
<font color="blue">Some text</font>
</template>
</mycontrol>
How do I achieve this? I've tried to declare the Template property of the
usercontrol like this:
<TemplateContainer(GetType(MegaItem))> public Property Template(key as
object) As ITemplate
....but I can't seem to solve it.
Please help
/john