470,624 Members | 2,246 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,624 developers. It's quick & easy.

How to create event when I put linkbutton inside repeater?

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

Nov 19 '05 #1
1 1984
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


Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Patrik Persson | last post: by
reply views Thread by Antonio Carpentieri | last post: by
4 posts views Thread by Antonio Carpentieri | last post: by
2 posts views Thread by msnews.microsoft.com | last post: by
reply views Thread by Demetri | last post: by
2 posts views Thread by Nathan Sokalski | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.