LinkButton Event Handler in ASP.NET 2.0

G

Guest

Hello

I have very recently moved from VS2003/ASP.Net 1.1 to VS2005/ASP.Net 2.0.

I have made up a web page which has many labels, image buttons and link
buttons. I am have a lot of trouble writing an event handler for a particular
link button and I have no idea why.

This is exactly what I am doing, step by step:
1. Add a link button to the form using the designer. Set control name as
"lbYourFilesExplained", and I set the text and class properties. I then press
save.
2. I then double-click on the control. This opens up the code view


The following code appears:

-------------------------------

Protected Sub lbYourFilesExplained_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles lbYourFilesExplained.Click

End Sub

-------------------------------

The following error then appears in the error list:
-------------------------------
Handles clause requires a WithEvents variable defined in the containing type
or one of its base types.
-------------------------------


This is so annoying! I already have one link button successfully on the
page, with an event handler, and it is working fine!

Have you any idea why I cannot create a second one?!! I can't work it out!
 
G

Guest

Try copy and paste controls to new form. Error in the beta 2 designer wasn't
fixed.

Good Luck
DWS
 
G

Guest

Thank you for your suggestions.

Unfortunately, the problem stems from the fact that I am a completely
incompetent buffoon.

I copied and pasted a .ASPX page into a new .ASPX to replicate a page
layout, and so it tried to share the same code-behind file, and this caused
several problems which are not the fault of the IDE.

I will now go and punish myself for my foolish behaviour.

Thank you kindly.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top