ButtonColumn as Image?

T

TheDude5B

I am using a ButtonColumn which is used to delete an item from the
datagrid.

Is it possible to use an image instead of just text for this
ButtonControl?


If this is not possible, then how would i change the code for this
ButtonControl to work with an ASP reapeater instead.

for example just now i have the buttoncontrol linked to the procedure

Sub Delete_Item (Sender As Object, E As DataGridCommandEventArgs)

objDT = Session("cart")
objDT.Rows(e.Item.ItemIndex).Delete()
Session("cart") = objDT

End Sub


but if using an asp repeater

i am wanting to use this code

<a href='<%#
Databinder.Eval(Container.DataItem,"ItemName","delete.aspx&id={0}" )
%>'><img src="images/x.gif" border="0" alt="Remove Item" />

to be used to delete the selected item. However as u will notice, the
code on the ASP repeater line will open up the page delete.aspx, I do
not want to do this and just be able to use code on the same page to
delete the selected row.

All Help is welcome.

Thanks
 
E

Elton Wang

Yes something like

<asp:ButtonColumn Text="<IMG src='~/Images/myImage.gif'; border='0'>"
CommandName="delete"></asp:ButtonColumn>

HTH
 

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,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top