ITemplate, TemplateContainer questions

S

Steve Richter

trying to understand how to support templates in server controls ...

a few quick questions on the following snippet of code pulled from a
server control class:

ITemplate _headingStyle;

[TemplateContainer(typeof(ICollectionLister2))]
public ITemplate HeadingStyle
{
get{ return _headingStyle; }
set{ _headingStyle = value; }
}

I thought ITemplate was an interface. How is it being used here as a
class?

What does the "[TemplateContainer(typeof(ICollectionLister2))]" stmt
line do when it proceeds the property "HeadingStyle"?

thanks,

-Steve
 
T

Teemu Keiski

TemplateContainer attribute specifies the type of the control which is the
naming container for the child controls in the template. Page parser uses it
when you use Container keyword in databinding syntax (for example
<%#Container.TypedPropertyHere%>)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,170
Latest member
Andrew1609
Top