Link to home
Start Free TrialLog in
Avatar of RyanBank
RyanBank

asked on

Compiler Error Message: BC30506: Handles clause requires a WithEvents variable.

hi,

Please assist how can we resolve the error? I'm using visual web developer 2005 express edition.

referece too
http://aspalliance.com/articleViewer.aspx?aId=21&pId=#Page1

scroll down to:
3.7 Using the TemplateSelection event



thanks.

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30506: Handles clause requires a WithEvents variable.
Source Error:
Line 57:     End Function
Line 58:
Line 59:     Private Sub HG1_TemplateSelection(ByVal sender As Object, ByVal e As DBauer.Web.UI.WebControls.HierarGridTemplateSelectionEventArgs) Handles HG1.TemplateSelection
Line 60:         e.TemplateFilename = "Templates\\" + e.Row.Table.TableName + ".ascx"
Line 61:     End Sub
Source File: c:\inetpub\wwwroot\test.aspx    Line: 59
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RyanBank
RyanBank

ASKER

<%@ Page Language="vb" AutoEventWireup="false" %>
<%@ Register TagPrefix="DBWC" Namespace="DBauer.Web.UI.WebControls" Assembly="DBauer.Web.UI.WebControls.HierarGrid" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">

.....
            &nbsp;<DBWC:HierarGrid ID="HG1" runat="server" TemplateDataMode="Table">
            </DBWC:HierarGrid>
What version of the HierarGrid do you have?  Is it the latest?

Bob
v2.2

thanks
I got it to work, place a comment on the code below.
'Handles HG1.TemplateSelection


can you kindly assist on this please:
https://www.experts-exchange.com/questions/21876224/HierarGrid-3-9-Displaying-one-template-for-all-child-rows.html