Hi,
I had added that before but I got the following message:
cmenu01' is already declared as 'Protected Dim cmenu01 As MyType' in
this class.
Do you know why?
I am working with Web Matrix because I just moved recently to ASP.NET.
I did use VS2003 for a while but it was a little bit confusing.
Since VS2005 and ASP.NET 2.0 are coming by the end of this year I
decided to keep working on Web Matrix.
Maybe I should go back to VS2003 again...
Cheers,
Miguel
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:ba****@NOSPAMdevelop.com:
It means you need a:
Dim WithEvents cmenu01 as WhateverTypeItIs
Are you in VS.NET 2003 or VS.NET 2005?
-Brock
DevelopMentor
http://staff.develop.com/ballen
Hello,
I have this in my aspx page:
Sub cmenu01_MenuItemSelected(ByVal sender As System.Object, ByVal e
As
MenuControl.Web.UI.MenuItemEventArgs) Handles cmenu01.ItemSelected
changeCulture(e.Item.Text)
End Sub
And I get this error:
Handles clause requires a WithEvents variable.
That is my problem.
What am I doing wrong?
Thanks,
Miguel
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:ba****@NOSPAMdevelop.com:
You use WithEvents if you want to handle events on that object using
the syntax:
Sub Button1_Clck() Handles Button1.Click
If I have my code in the aspx page itself what the code line
"Protected WithEvents Menu1 As MenuControl.Web.UI.Menu" should look
like in my aspx page. I just don't know how to declare an WithEvents
Variable on a aspx.page.
I'm not sure what your question is, since the code block you show is
declaring
a variable that way. You only use it when you want to automatically
handle
the events as I mention above. Otherwise you don't need it.
-Brock
DevelopMentor
http://staff.develop.com/ballen