Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Using ITemplate as property of a custom control

Reply
Thread Tools

Using ITemplate as property of a custom control

 
 
yawarady@gmail.com
Guest
Posts: n/a
 
      01-24-2007
Hi,

I am using ITemplate as property of a custom control in order to get
the following struct:

<test:mycontrol>
<myTemplate>
<asp:TextBox..........
</myTemplate>
</test:mycontrol>

The only thing that I want to add now is a property to the myTemplate
tag, in order to be able to set something like:
<myTemplate Text="testing">

Is there any way to accomplish this change?

Thanks

 
Reply With Quote
 
 
 
 
Nathaniel Greene
Guest
Posts: n/a
 
      01-24-2007
You would probably have to create a class that implements ITemplate and
create a property there. I am guessing you want the property to be linked
with the content inside of the template? That may be more difficult depending
upon what that content can actually be changed to by the user.

"(E-Mail Removed)" wrote:

> Hi,
>
> I am using ITemplate as property of a custom control in order to get
> the following struct:
>
> <test:mycontrol>
> <myTemplate>
> <asp:TextBox..........
> </myTemplate>
> </test:mycontrol>
>
> The only thing that I want to add now is a property to the myTemplate
> tag, in order to be able to set something like:
> <myTemplate Text="testing">
>
> Is there any way to accomplish this change?
>
> Thanks
>
>

 
Reply With Quote
 
 
 
 
yawarady@gmail.com
Guest
Posts: n/a
 
      01-24-2007
Hi,

I tried to create a class that implements ITemplate and create the
property there but I'm getting this annoying error that I can't
overcome:
Error 1 Cannot implicitly convert type
'System.Web.UI.CompiledTemplateBuilder' to
'Controls.myTemplate' c:\Inetpub\wwwroot\Builder\Default.aspx 12
As for you question, the content of the template should be any type of
one or more controls.

Thanks.


On Jan 24, 6:56 pm, Nathaniel Greene
<(E-Mail Removed)> wrote:
> You would probably have to create a class that implements ITemplate and
> create a property there. I am guessing you want the property to be linked
> with the content inside of the template? That may be more difficult depending
> upon what that content can actually be changed to by the user.
>
>
>
> "(E-Mail Removed)" wrote:
> > Hi,

>
> > I am using ITemplate as property of a custom control in order to get
> > the following struct:

>
> > <test:mycontrol>
> > <myTemplate>
> > <asp:TextBox..........
> > </myTemplate>
> > </test:mycontrol>

>
> > The only thing that I want to add now is a property to the myTemplate
> > tag, in order to be able to set something like:
> > <myTemplate Text="testing">

>
> > Is there any way to accomplish this change?

>
> > Thanks- Hide quoted text -- Show quoted text -


 
Reply With Quote
 
Peter Zolja
Guest
Posts: n/a
 
      01-31-2007
> I tried to create a class that implements ITemplate and create the
> property there but I'm getting this annoying error that I can't
> overcome:
> Error 1 Cannot implicitly convert type
> 'System.Web.UI.CompiledTemplateBuilder' to
> 'Controls.myTemplate' c:\Inetpub\wwwroot\Builder\Default.aspx 12


If you would post some code we may be able to help you out. A simple search
for implementing ITemplate returned this page
(http://www.tek-tips.com/faqs.cfm?fid=4867) that has an example you could
use.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Programmaticly load a custom UserControl with in a custom class which implements an ITemplate LaptopHeaven ASP .Net 0 10-05-2006 12:36 PM
Newbie:Access custom Itemplate(not datagrid/repeater/datalist) control values on postback Luhar Powell via .NET 247 ASP .Net Building Controls 0 04-01-2005 04:59 PM
Newbie:Access custom Itemplate(not datagrid/repeater/datalist) control values on postback Luhar Powell via .NET 247 ASP .Net 0 04-01-2005 04:58 PM
Newbie:Access custom Itemplate(not datagrid/repeater/datalist) control values on postback Luhar Powell via .NET 247 ASP .Net Web Controls 0 04-01-2005 04:56 PM
Custom web control - Unable to capture events with AddHandler in an ITemplate Eli Gassert ASP .Net Datagrid Control 0 06-11-2004 03:24 AM



Advertisments