How to create event when I put linkbutton inside repeater?

Discussion in 'ASP .Net' started by smash2004@gmail.com, Aug 4, 2005.

  1. Guest

    I have VS 2005 CTP.

    I created a page with one repeater. Inside i put a linkbutton.

    Usually when i put linkbutton on a page I doubleclick it in designview
    and event gets created in codebehind file. Now i can't click on
    anything because my linkbutton is not visible in the designer.

    So i moved my linkbutton outside the repeater and doubleclicked it and
    code gets created. With code created I moved my linkbutton again inside
    the repeater. I run the project by it failed. It writes:

    Handles clause requires a WithEvents variable defined in the containing
    type or one of its base types

    In VS2003 i could wrote the "withevent" stuff myself, but here
    everything is automatic so i don't know how to solve this problem.

    If anyone has an idea, i'll appreciated. Thx
    , Aug 4, 2005
    #1
    1. Advertising

  2. Brock Allen Guest

    WHat do you want to happen when the user clicks the LinkButton? Does it depend
    upon what row is clicked in the repeater? If so, you should look into handling
    the Repeater's ItemCommand event instead.

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > I have VS 2005 CTP.
    >
    > I created a page with one repeater. Inside i put a linkbutton.
    >
    > Usually when i put linkbutton on a page I doubleclick it in designview
    > and event gets created in codebehind file. Now i can't click on
    > anything because my linkbutton is not visible in the designer.
    >
    > So i moved my linkbutton outside the repeater and doubleclicked it and
    > code gets created. With code created I moved my linkbutton again
    > inside the repeater. I run the project by it failed. It writes:
    >
    > Handles clause requires a WithEvents variable defined in the
    > containing type or one of its base types
    >
    > In VS2003 i could wrote the "withevent" stuff myself, but here
    > everything is automatic so i don't know how to solve this problem.
    >
    > If anyone has an idea, i'll appreciated. Thx
    >
    Brock Allen, Aug 4, 2005
    #2
    1. Advertising

  3. Smash Guest

    you are so right :) i don't know WHAT was i thinking :) thx
    Smash, Aug 5, 2005
    #3
    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. Michael
    Replies:
    1
    Views:
    2,606
    Michael
    Dec 7, 2004
  2. Sathyaish
    Replies:
    3
    Views:
    3,087
    Sathyaish
    Sep 8, 2005
  3. msnews.microsoft.com
    Replies:
    2
    Views:
    6,453
    msnews.microsoft.com
    Nov 23, 2005
  4. sloan
    Replies:
    1
    Views:
    3,495
    =?Utf-8?B?TGFkaXNsYXYgTXJua2E=?=
    Aug 17, 2007
  5. mikelor

    Multiple LinkButton and Event Handlers in a Repeater

    mikelor, Jul 16, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    390
Loading...

Share This Page