Image edit buttons in DataList's ItemTemplate doesn't work ??

Image edit buttons in DataList's ItemTemplate doesn't work ??

Post by kaze » Fri, 07 Dec 2001 04:50:31



I am using VS.NET beta2. I have declared an ItemTemplate of a DataList in a
aspx file. In that template, I added an image button to it and set it's
CommandName attribute to "edit". Then I generated the event handler in the
codebehind file for EditCommand of the DataList. But the handler never been
fired up when I clicked the image button. But it work perfectly if I change
the image button to link button.

Anyone has the same problem ? Maybe it is just a bug in beta2 ?

thank you,
kaze

 
 
 

Image edit buttons in DataList's ItemTemplate doesn't work ??

Post by kaze » Fri, 07 Dec 2001 04:56:05


Not only image button of EditCommand doesn't work in ItemTemplate of
DataList, I find that all image buttons with any CommandName attribute also
doesn't work too.

Anyone has the same problem ?

kaze


Quote:> I am using VS.NET beta2. I have declared an ItemTemplate of a DataList in
a
> aspx file. In that template, I added an image button to it and set it's
> CommandName attribute to "edit". Then I generated the event handler in the
> codebehind file for EditCommand of the DataList. But the handler never
been
> fired up when I clicked the image button. But it work perfectly if I
change
> the image button to link button.

> Anyone has the same problem ? Maybe it is just a bug in beta2 ?

> thank you,
> kaze


 
 
 

Image edit buttons in DataList's ItemTemplate doesn't work ??

Post by Daniel Garci » Sat, 08 Dec 2001 06:20:55


Kaze,

I also have the same problem but I've been able to work around it by placing
an image inside the link button. The link button fires the event (as you
mention) and the image gives me the look I want:

<ItemTemplate>
 <asp:LinkButton id="Edit_button" runat="server" CommandName="Edit">
  <asp:Image id="Image1" ImageUrl="test.gif" runat="server"></asp:Image>
 </asp:LinkButton>
</ItemTemplate>

Hope this helps,

Daniel Garcia
Openwebs Corporation
www.openwebs.com


> Not only image button of EditCommand doesn't work in ItemTemplate of
> DataList, I find that all image buttons with any CommandName attribute
also
> doesn't work too.

> Anyone has the same problem ?

> kaze



> > I am using VS.NET beta2. I have declared an ItemTemplate of a DataList
in
> a
> > aspx file. In that template, I added an image button to it and set it's
> > CommandName attribute to "edit". Then I generated the event handler in
the
> > codebehind file for EditCommand of the DataList. But the handler never
> been
> > fired up when I clicked the image button. But it work perfectly if I
> change
> > the image button to link button.

> > Anyone has the same problem ? Maybe it is just a bug in beta2 ?

> > thank you,
> > kaze