Re: Adding LinkButton + click Event dynamically

Discussion in 'ASP .Net' started by Vaibhav, Aug 28, 2003.

  1. Vaibhav

    Vaibhav Guest

    AddHandler objLinkButton.Click, Addressof doMySub

    doMysub should be declared like this
    Private Sub doMySub(ByVal sender As System.Object, ByVal e As
    System.EventArgs)

    Response.Write("TestString")

    End Sub

    HTH

    "ElmoWatson" <> wrote in message
    news:...
    > I've got a Linkbutton successfully being added to a Placeholder:
    > objLinkButton= New System.Web.UI.WebControls.LinkButton
    > objHR= New System.Web.UI.HtmlControls.HtmlGenericControl
    > objLinkButton.ID="lbLogout"
    > objLinkButton.Font.Bold="True"
    > ph1.controls.Add(objLinkButton)
    >
    > However, I can't figure out what the syntax is for assigning an onclick
    > event for the Linkbutton - - in the tag, I'd normally put - -
    > onclick="doMySub"
    >
    > How do I add a click event (Note: I'm using Inline coding - NOT

    code-Behind)
    > in this scenario?
    >
    >
    Vaibhav, Aug 28, 2003
    #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:
    820
    Purvi T
    Oct 19, 2004
  2. Felipe Garcia
    Replies:
    1
    Views:
    5,865
    ElmoWatson
    Aug 28, 2003
  3. Chu
    Replies:
    2
    Views:
    894
    Winista
    Apr 10, 2006
  4. Max2006
    Replies:
    2
    Views:
    1,552
    Walter Wang [MSFT]
    Sep 19, 2007
  5. Jack
    Replies:
    1
    Views:
    480
Loading...

Share This Page