DataList UserControl Load Dynamically

G

Guest

I have a default page that I load usercontrols depending on requirements
through a master template using a PlaceHolder i.e.
//some logic here.....
Control UCUsers = LoadControl("../UserControls/users.ascx");
PlaceHolderUC.Controls.Add(UCUsers );

the datalist control (ascx) loads correctly but when I try click the
datalist template image button

i.e. <ItemTemplate>
<asp:ImageButton ID="imgBtnClick" tooltip ="click to view
user" height="8" ImageUrl="../Images/icon_blue_triangle.gif" runat="server"
CommandName="show" />
<%# DataBinder.Eval(Container.DataItem, "username")%>
<%# DataBinder.Eval(Container.DataItem, "startdate",
"{0:d}")%>
</ItemTemplate>

the control dissapears and even putting a breakpoint on the
DataList_ItemCommand
method does not get hit

can any suggest a workaround for this
Thanks
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top