Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Javascript in HyperLink Button

Javascript in HyperLink Button

Scheduled Pinned Locked Moved ASP.NET
javascripthtmlquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    danasegaranea
    wrote on last edited by
    #1

    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)

    V 2 Replies Last reply
    0
    • D danasegaranea

      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)

      V Offline
      V Offline
      vijay_chaudhary
      wrote on last edited by
      #2

      Hi danasegaranea, Try this one.. hyperlinkbuttonID.Attribute.Add("onclick","JavascriptFunctionName();"); Happy Programming

      1 Reply Last reply
      0
      • D danasegaranea

        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)

        V Offline
        V Offline
        vijay_chaudhary
        wrote on last edited by
        #3

        Hi danasegaranea, Try this one.. hyperlinkbuttonID.Attributes.Add("onclick","JavascriptFunctionName();"); Happy Programming

        D 1 Reply Last reply
        0
        • V vijay_chaudhary

          Hi danasegaranea, Try this one.. hyperlinkbuttonID.Attributes.Add("onclick","JavascriptFunctionName();"); Happy Programming

          D Offline
          D Offline
          danasegaranea
          wrote on last edited by
          #4

          Thanks Vijay, I have done like this and its working

          hlCopy.Attributes.Add("OnClick", "javascript:checkall()")

          Dana

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups