Link Button Question

G

Guest

Hi,

I have a linkbutton inside datalist whose visibility is controlled by
variable declared on Page.Init method. It appears fine. I need to add on
click attributes to confirm user to delete file. However i cant seem to get
it done. I used Itemdatabound for datalist and still didnt work. Here is my
code.
<asp:DataList id="dListExecDescription" runat="server" Width="100%">
<TABLE id="Table3" cellSpacing="3" cellPadding="1" width="100%"
border="0"> <TR><TD>
<asp:LinkButton id="Linkbutton1" runat="server" Visible="<%# boolVisible %>"
onCommand="editBio_Command" CommandArgument='<%#
DataBinder.Eval(Container.DataItem,"id") %>' CommandName="Delete">Delete
Bio</asp:LinkButton></TD>

Sub dgPopularFAQs_ItemDataBound(ByVal sender As Object, ByVal e As
DataListItemEventArgs)
Dim deleteButton As LinkButton
deleteButton = e.Item.FindControl("Linkbutton1")
deleteButton.Attributes.Add("onClick", "javascript:return
confirm('Are you sure you want to delete FAQ #')")

Response.Write(e.Item.FindControl("Linkbutton1"))
Can someone please tell me what am i doing wrong? or maybe post some sample
code.

thanks

manny
 

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,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top