Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Problem with usercontrol/itemplate

Thread Tools

Problem with usercontrol/itemplate

Thomas Wagner
Posts: n/a
Hi group,

I try to develop a gallery control, that uses templates for displaying.
Everything should (as I can say) be correct, but "InstantiateIn" does not
get the right data from my container-class.

The source looks like this, could someone please help me, I have no idea
what I did wrong!
(Note: When I change "Container.Url" to "Container.XXX", the compiler
recognizes, that XXX is not a member of ImageTemplateContainer.)

Thank you

/* Container: */

public class ImageTemplateContainer : Control, INamingContainer
private String m_strUrl;
public String Url
return m_strUrl;

public ImageTemplateContainer(String NavUrl)
this.m_strUrl = NavUrl;

/* Control: */

[ToolboxData("<{0}:Gallery runat=server></{0}:Gallery>")]
public class Gallery : WebControl, INamingContainer
private ITemplate m_ImageTemplate = null;

public virtual ITemplate ImageTemplate
get { return m_ImageTemplate; }
set { m_ImageTemplate = value; }

private ImageTemplateContainer m_itcContainer;
public ImageTemplateContainer Container
return m_itcContainer;

protected override void CreateChildControls()
if (m_ImageTemplate != null)

m_itcContainer = new ImageTemplateContainer("imagetest.jpg");

this.Controls.Add(new LiteralControl("Nixda"));

/* aspx */

<cc1:Gallery ID="Gallery1" runat="server" EnableViewState="true" >
<ImageTemplate><%# Container.Url %></imageTemplate>

Reply With Quote

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
Problem problem problem :( Need Help Mike ASP General 2 05-11-2004 08:36 AM