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(ByVa l sender As Object, _
Line 47: ByVal e As HierarGridTemplateSelectio nEventArgs ) _
Line 48: Handles HG1.TemplateSelection
Line 49: e.TemplateFilename = "Template\\Sup.ascx"
Line 50: End Sub
Source File: c:\inetpub\wwwroot\test.as px Line: 48
Please assist where do I type this code in?
Protected WithEvents HG1 As DBauer.Web.UI.WebControls.
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(ByVa
Line 47: ByVal e As HierarGridTemplateSelectio
Line 48: Handles HG1.TemplateSelection
Line 49: e.TemplateFilename = "Template\\Sup.ascx"
Line 50: End Sub
Source File: c:\inetpub\wwwroot\test.as
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I got it, i remove the sub and double click the control it generated the right sub
ASKER
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.
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.W
Line 2: <%@ Page Language="vb" AutoEventWireup="true" Debug="true" %>
Line 3: <%@ import Namespace="System.Data" %>
Source File: c:\inetpub\wwwroot\test.as