Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Error using VB2008 with ASP.NET
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Error using VB2008 with ASP.NET

 Post Reply Post Reply
Author
 Rating: Topic Rating: 1 Votes, Average 1.00  Topic Search Topic Search  Topic Options Topic Options
A novice View Drop Down
Newbie
Newbie


Joined: 18 November 2009
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote A novice Quote  Post ReplyReply Direct Link To This Post Topic: Error using VB2008 with ASP.NET
    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)

Back to Top
cybermikey79 View Drop Down
Newbie
Newbie
Avatar

Joined: 15 January 2010
Location: Indonesia
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote cybermikey79 Quote  Post ReplyReply Direct Link To This Post 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 "

Back to Top
A novice View Drop Down
Newbie
Newbie


Joined: 18 November 2009
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote A novice Quote  Post ReplyReply Direct Link To This Post Posted: 15 January 2010 at 10:06am
Thanks for your help
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.