Results 1 to 4 of 4

Thread: asp.net 2003 Programmatically code click event of Link Button

  1. #1
    Join Date
    Mar 2006
    Posts
    35
    Rep Power
    0

    Default asp.net 2003 Programmatically code click event of Link Button

    Hello,

    I'm interested in finding out how to dynamically and/or programmatically code the click event of a link button.

    Can anyone help please?

    Thanks

  2. #2
    Join Date
    May 2003
    Posts
    108
    Rep Power
    0

    Default

    Dim strURL as string = "http://www.slbja.com"
    LinkButton1.Attributes.Add("onclick", strURL)

  3. #3
    Join Date
    Jul 2006
    Posts
    239
    Rep Power
    0

    Default

    How About:

    LinkButton1.PostBackUrl = "http://www.techjamaica.com"
    LinkButton1.Text = "Click Here for TechJamaica!"

    Much Eaiser!

  4. #4
    Join Date
    Dec 2004
    Posts
    1,181
    Rep Power
    0

    Default

    Can't quite rememebr, but try this.
    Code:
    Protected Sub MyClickEvent(o as Object, e as EventArgs)
          'Put whatever code you would like here
    End Sub
    
    'When you are ready to add your event, just...
    AddHandler MyButton.Click, AddressOf MyClickEvent
    'If we're supposed to work in Hex, why have we only got A fingers?'

    Follow Me: @psybuck2002us

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •