Handles clause requires a WithEvents variable

D

dancer

I get this compilation error:

Handles clause requires a WithEvents variable

I know I need to declare a WithEvents variable, but I don't know how or
where.

Here is a part of the code:
<%@ Page Language="VB" debug="true" %>

<%@ Import Namespace="System.Data.Oledb" %>

<%@ Import Namespace="System.Data.DataSet" %>

<%@ Import Namespace="System.Data.Oledb.OleDbDataAdapter" %>

<%@ Import Namespace="System.IO.StringWriter" %>

<%@ Import Namespace="System.Web.UI.HtmlTextWriter" %>



<script runat="server">

Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSubmit.Click


Dim intFileNameLength As Integer
Dim strFileNamePath As String
Dim strFileNameOnly As String

If Not (UploadFile.PostedFile Is Nothing) Then
strFileNamePath = UploadFile.PostedFile.FileName
 
T

Teemu Keiski

Since you use inline page, you basically can't since members are by the page
parsing/compiling process. Do it by setting OnClick="btnSubmit_Click" on the
<asp:Button>
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top