LinkButton

Discussion in 'ASP .Net' started by Hugo Flores, Jul 4, 2003.

  1. Hugo Flores

    Hugo Flores Guest

    Hi,
    I create a LinkButton in runtime, and I want to be able to
    access a function when a user clicks on the generated link
    in the page.
    My problem is that I don't know how to asociate the
    function to the link in runtime.

    Any one knows this?
    Hugo Flores, Jul 4, 2003
    #1
    1. Advertising

  2. Hugo Flores

    Jos Branders Guest

    Hugo Flores wrote:
    > Hi,
    > I create a LinkButton in runtime, and I want to be able to
    > access a function when a user clicks on the generated link
    > in the page.
    > My problem is that I don't know how to asociate the
    > function to the link in runtime.
    >
    > Any one knows this?


    AddHandler myLinkButton.Click, AddressOf myLinkButton_Click

    --

    Jos Branders
    Jos Branders, Jul 4, 2003
    #2
    1. Advertising

  3. After you create the object at runtime, use the AddHandler command.

    AddHandler Button1.Click, AddressOf Button1_Click


    Hope this helps,

    Jurjen de Groot
    G.I.T.S. Netherlands


    "Hugo Flores" <> wrote in message
    news:011f01c3424c$b3b86620$...
    > Hi,
    > I create a LinkButton in runtime, and I want to be able to
    > access a function when a user clicks on the generated link
    > in the page.
    > My problem is that I don't know how to asociate the
    > function to the link in runtime.
    >
    > Any one knows this?
    Jurjen de Groot, Jul 4, 2003
    #3
  4. Hugo Flores

    Hugo Flores Guest

    Thenk you both for your answer

    >-----Original Message-----
    >Hi,
    >I create a LinkButton in runtime, and I want to be able

    to
    >access a function when a user clicks on the generated

    link
    >in the page.
    >My problem is that I don't know how to asociate the
    >function to the link in runtime.
    >
    >Any one knows this?
    >.
    >
    Hugo Flores, Jul 4, 2003
    #4
  5. Hugo Flores

    David Waz... Guest

    As Jurjen pointed out, ADD HANDLER works,
    OR - Create a page-level WITHEVENTS variable

    in either case, be sure the dynamic control is created on all post-back
    operations. If you don't, the event won't be trapped.

    If you are referring to client-side (java script):

    MyControl.Attributes.item("OnClick") = "return MyFunction();"

    G.L.


    "Hugo Flores" <> wrote in message
    news:011f01c3424c$b3b86620$...
    > Hi,
    > I create a LinkButton in runtime, and I want to be able to
    > access a function when a user clicks on the generated link
    > in the page.
    > My problem is that I don't know how to asociate the
    > function to the link in runtime.
    >
    > Any one knows this?
    >
    David Waz..., Jul 4, 2003
    #5
    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. Fresh Air Rider
    Replies:
    0
    Views:
    536
    Fresh Air Rider
    Mar 2, 2004
  2. Jeelz
    Replies:
    2
    Views:
    605
    Vidar Petursson
    Jun 28, 2003
  3. Vik
    Replies:
    0
    Views:
    323
  4. Sathyaish
    Replies:
    3
    Views:
    3,079
    Sathyaish
    Sep 8, 2005
  5. Sathyaish

    Linkbutton does not look like a linkbutton

    Sathyaish, Sep 8, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    170
    Sathyaish
    Sep 8, 2005
Loading...

Share This Page