Javascript in HyperLink Button
-
Hi all, I am adding one HyperLink Button in My HTML Table. Now I want to excute an Javascript Function on the click Event of that HyperLink Button. How can I. Here is the code I am using for creating the Hyperlink Button
Dim TH As New TableHeaderCell
Dim hlCopy As New HyperLink
hlCopy.ID = "hlCopy"
hlCopy.ImageUrl = "images/ArrowDownRed.gif"
hlCopy.BorderWidth = Unit.Pixel(1)
'hlCopy.NavigateUrl = "javscript:checkall()"
TH.HorizontalAlign = HorizontalAlign.Center
TH.Width = Unit.Percentage(Perc)
TH.Text = Text
th.Controls.Add(hlCopy)
TR.Cells.Add(TH) -
Hi all, I am adding one HyperLink Button in My HTML Table. Now I want to excute an Javascript Function on the click Event of that HyperLink Button. How can I. Here is the code I am using for creating the Hyperlink Button
Dim TH As New TableHeaderCell
Dim hlCopy As New HyperLink
hlCopy.ID = "hlCopy"
hlCopy.ImageUrl = "images/ArrowDownRed.gif"
hlCopy.BorderWidth = Unit.Pixel(1)
'hlCopy.NavigateUrl = "javscript:checkall()"
TH.HorizontalAlign = HorizontalAlign.Center
TH.Width = Unit.Percentage(Perc)
TH.Text = Text
th.Controls.Add(hlCopy)
TR.Cells.Add(TH)Hi danasegaranea, Try this one.. hyperlinkbuttonID.Attribute.Add("onclick","JavascriptFunctionName();"); Happy Programming
-
Hi all, I am adding one HyperLink Button in My HTML Table. Now I want to excute an Javascript Function on the click Event of that HyperLink Button. How can I. Here is the code I am using for creating the Hyperlink Button
Dim TH As New TableHeaderCell
Dim hlCopy As New HyperLink
hlCopy.ID = "hlCopy"
hlCopy.ImageUrl = "images/ArrowDownRed.gif"
hlCopy.BorderWidth = Unit.Pixel(1)
'hlCopy.NavigateUrl = "javscript:checkall()"
TH.HorizontalAlign = HorizontalAlign.Center
TH.Width = Unit.Percentage(Perc)
TH.Text = Text
th.Controls.Add(hlCopy)
TR.Cells.Add(TH)Hi danasegaranea, Try this one.. hyperlinkbuttonID.Attributes.Add("onclick","JavascriptFunctionName();"); Happy Programming
-
Hi danasegaranea, Try this one.. hyperlinkbuttonID.Attributes.Add("onclick","JavascriptFunctionName();"); Happy Programming
Thanks Vijay, I have done like this and its working
hlCopy.Attributes.Add("OnClick", "javascript:checkall()")
Dana