Print Page | Close Window

Error using VB2008 with ASP.NET

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=28041
Printed Date: 29 March 2026 at 2:07pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Error using VB2008 with ASP.NET
Posted By: A novice
Subject: Error using VB2008 with ASP.NET
Date Posted: 18 November 2009 at 1:55pm
Hi
I'm very new to both ASP.NET and VB so I'm working through a study book but have hit an error.  i dont know if the error is in the book as I;ve copied the code from there or if it's the fact that I've done something silly but basically I recieve the followingh error when I debug using Visual Studio:
'Error 1 Handles clause requires a WithEvents variable defined in the containing type or one of its base types.'  This is referring to line 4 column 101 of the below code.  Please can someone tell me how to resolve the error, it's driving me mad!!!  The file in question is only on my pc so I'm assuming sending a link to it wont be useable and have had to post the code below instead:Cry  Thank you!!!

Partial Public Class Currency

Inherits System.Web.UI.Page

Protected Sub ShowGraph_ServerClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ShowGraph.ServerClick

Graph.Src = "Pic" + Currency.SelectedIndex.ToString() + ".png"

Graph.Visible = True

End Sub

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)




Replies:
Posted By: cybermikey79
Date Posted: 15 January 2010 at 6:39am
Sir, make sure the declaration includes a "withevents" statement that's why you're receiving this error " requires a WithEvents variable "



Posted By: A novice
Date Posted: 15 January 2010 at 10:06am
Thanks for your help



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net