ASP.NET 2.0 Link Button & Runtime Click Handler

Discussion in 'ASP .Net Web Controls' started by JumpingMattFlash, Aug 11, 2006.

  1. I'm currently creating a number of LinkButtons dynamically using information
    from the database.

    However I'm struggling to find out how i can react to the user clicking on
    them. For some reason the onclick event handler is 'Protected'

    I'm trying to use the following code but it will not compile due to the
    underlined line

    Dim LinkButton As New LinkButton
    LinkButton.Text = LinkText


    LinkButton.ID = "Unique Number"
    LinkButton.CausesValidation =
    False

    LinkButton.CommandName = "Name of Parameter"

    LinkButton.CommandArgument = "Parameter Value"
    LinkButton.onclick = "ChangeOrg"


    The annoying thing is that i can set the click event handler using the HTML
    designer but not programmatically. If anyone has experienced this before and
    can provide some assistance it will be gratefully recieved

    Many thanks!

    --
    =============
    VB .NET Developer
    http://www.rocketscience.uk.com
     
    JumpingMattFlash, Aug 11, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Purvi T
    Replies:
    0
    Views:
    932
    Purvi T
    Oct 19, 2004
  2. Andrew Connell
    Replies:
    0
    Views:
    392
    Andrew Connell
    Nov 12, 2003
  3. George
    Replies:
    2
    Views:
    5,784
    George
    Jan 28, 2004
  4. Amy
    Replies:
    0
    Views:
    1,038
  5. Peter Kirk

    asp button click handler

    Peter Kirk, Dec 9, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    167
    Peter Kirk
    Dec 9, 2005
Loading...

Share This Page