Link to home
Start Free TrialLog in
Avatar of RyanBank
RyanBank

asked on

code behind

Hi,

Please assist where do I type this code in?
    Protected WithEvents HG1 As DBauer.Web.UI.WebControls.HierarGrid

The website says it should go in code behind,  I'm using Visual Web Dev 2005 Express edition, which can only edit aspx pages. where in both code and html are in one page.

Thanks.
   
In reference too:

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 46:     Private Sub HG1_TemplateSelection(ByVal sender As Object, _
Line 47: ByVal e As HierarGridTemplateSelectionEventArgs) _
Line 48: Handles HG1.TemplateSelection
Line 49:         e.TemplateFilename = "Template\\Sup.ascx"
Line 50:     End Sub
Source File: c:\inetpub\wwwroot\test.aspx    Line: 48
ASKER CERTIFIED SOLUTION
Avatar of Edwin_C
Edwin_C
Flag of Hong Kong 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

Edwin_C

When I added the ode the following error occured:

<script runat="server">
Public Class hourly  Inherits System.Web.UI.Page
        Protected WithEvents HG1 As DBauer.Web.UI.WebControls.HierarGrid



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: BC30456: '__control2' is not a member of 'ASP.test_aspx.test'.
Source Error:
Line 1:  <%@ Register TagPrefix="DBWC" Namespace="DBauer.Web.UI.WebControls" Assembly="DBauer.Web.UI.WebControls.HierarGrid" %>
Line 2:  <%@ Page Language="vb" AutoEventWireup="true" Debug="true" %>
Line 3:  <%@ import Namespace="System.Data" %>
Source File: c:\inetpub\wwwroot\test.aspx    Line: 1
I got it, i remove the sub and double click the control it generated the right sub