473,397 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Link Button Question

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
Nov 19 '05 #1
2 1013
No worries...its fixed.

"Manny Chohan" wrote:
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

Nov 19 '05 #2
I have the same problem, how did you fix it?

"Manny Chohan" wrote:
No worries...its fixed.

"Manny Chohan" wrote:
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

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stanimir Stamenkov | last post by:
Here's an example: <form action="bogus" method="post"> <p> <a href="prev.cgi"><input type="submit" name="prev" value="< Back"></a> <a href="next.cgi"><input type="submit" name="next"...
3
by: rachel | last post by:
Hi all, I am new in ASP.Net. I have a question on link multiple web forms together. Here is the scenario: I create an Index.aspx WebForm which consists of a banner and three navigator...
3
by: Chris Wilkinson | last post by:
Hi there, I'm creating a frames website, which consists of a nav bar down the left of the screen (name="frame1") and a content frame filling the right hand side (name="frame2"). I've used nice...
6
by: nntp | last post by:
I have a set of links which I want search engines to crawl them, but I want to disable them from my visitors, so I will ask the link owners to pay me to let me enable them. <a disabled...
7
by: ravey | last post by:
I would like to use a Form "button" (or "input", either one) within an anchor, instead of using text or creating a graphic. This works fine in all browsers but IE, but IE, while showing the...
1
by: Darren Clark | last post by:
I have a link button that i would like to be used if the value of the text is NOT 0... So the code below will always make a linkbutton.... However if the value of...
4
by: WebBuilder451 | last post by:
I have about 20 link buttons that i need handled by one sub. I don't want to have 20 onClick_xxx subs or onCommand subs. I'm not having much luck calling a single sub for all the button or figuring...
26
by: Mica Cooper | last post by:
Hi, I need to pass some info in a javascript submit. <a href="javascript:document.formName.submit();">Submit Form</a> Normally a link would do page.jsp?x1=1&x2=2&x3=3 and you would pull x1,...
5
by: Amoril | last post by:
I've read quite a few different message on various boards and for some reason I'm still having trouble wrapping my head around this viewstate maintenance and trying to get these dynamically created...
6
by: liketofindoutwhy | last post by:
There is a link that encloses a span (or a div), but the link won't work in IE 7 (clicking on video image works, but not on the play button), while it works well in Firefox 2 and 3, and Safari 3....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.