473,395 Members | 1,613 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

ITemplate, TemplateContainer questions

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

Nov 19 '05 #1
2 2312
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%>)

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
"Steve Richter" <St************@gmail.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
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

Nov 19 '05 #2
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%>)

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
"Steve Richter" <St************@gmail.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
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

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: cosine... zero | last post by:
Hi! I've got a databound templated control that I want the itemplate class itself to be postback aware to process form data. But calling Page.RegisterRequiresPostBack( instantiatedtemplate )...
1
by: cosine... zero | last post by:
Hi - I want to build a templated control that can change types of the template at runtime. Possible? I would need to have TemplateContainer be a type that's either an abstract / inherited...
0
by: Steve Richter | last post by:
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; ...
0
by: vicgroups | last post by:
Hello, I am adding columns to the datagrid programmatically. And I have created a countries drop down list in an ascx file. I have added the countries drop down list to the datagrid column as...
0
by: LaptopHeaven | last post by:
I am having some trouble. How would one load a custom UserControl fro within a class which impements the ITemplate interface. Currently I have the following: public class...
5
by: Ben Schumacher | last post by:
Ok smart guys and gals ... I have a GridView control with a dynamically created checkbox column. The checkbox is created using ITemplate interface. In my class that implements the ITemplate...
0
by: imranabdulaziz | last post by:
Hi all, I am using asp.net2.0 and C# VS2005. I am creating asp.net web server control templates Dynamically . My requirement is such that sp return very no of field( 4 or 5 or 6 …). Now I am...
2
by: DC | last post by:
Hi, I am trying to implement a simple template control (to be used as TemplateItem etc. in GridView). Does someone see why my code fails? I give up for now and try a different approach (http://...
1
by: wojski696969 | last post by:
Hi, i've made my own Custom Server Control, wich inherits from WebControl class. Inside of my control I've create three ITemplate properties wich should be used as containers for Head, Content and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.