Re: Using ITemplate as property of a custom control

Tech-Archive recommends: Fix windows errors by optimizing your registry



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
<Nathaniel.Gre...@xxxxxxxxxxxxxxxx> 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.



"yawar...@xxxxxxxxx" 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 -

.



Relevant Pages

  • ITemplate and ControlBuilder
    ... below map the "SomeTemplate" template to an ITemplate property without ... compiling the content as a template. ... public class SampleControl: Control, IParserAccessor ... public ITemplate SampleTemplate ...
    (microsoft.public.dotnet.framework.aspnet.buildingcontrols)
  • Re: apply an ItemTemplate dinamically
    ... databound control. ... Such ITemplate property is designed to be configured ... the template, ... a lot of work to design and manage layout's rendering. ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • RE: Adding controls to EditableDesignerRegion/ITemplate in code.
    ... something similar to a ControlCollection to add objects inside the template ... The ITemplate class is included below. ... /// that child controls and templates belong to. ...
    (microsoft.public.dotnet.framework.aspnet.buildingcontrols)
  • Template control error
    ... private ITemplate _template; ... public TestPanel Panel ... public virtual ITemplate Template ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Error when I open a .DOT file
    ... overcome the problem, you should take it up with the person who created the ... Doug Robbins - Word MVP ... > I've got a .DOT document which whenever I open appears a dialogbox ... > When I click yes, appears the template two seconds and after that, MS Word ...
    (microsoft.public.word.mailmerge.fields)