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.
<aspataList 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
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.
<aspataList 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