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

Forum statistics

Threads
473,743
Messages
2,569,477
Members
44,898
Latest member
BlairH7607

Latest Threads

Top