PLEASE HELP

lawlitiaveaks

New Member
Hi, I'm having a problem with visualstudio.net and code behind files. I'm trying to get a server side form working with code behind files, and i get nada... below is the code. could someone please point out what i'm missing. The error i get is "Compiler Error Message: BC30456: 'btnAddtoCart_click' is not a member of 'ASP.form_aspx'."<BR><BR>[form.aspx]<BR><%@ Page Language="vb" Codebehind="form.aspx.vb" %><BR><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><BR><HTML><BR> <HEAD><BR> <title>form</title><BR> <meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0"><BR> <meta name="CODE_LANGUAGE" content="Visual Basic 7.0"><BR> <meta name="vs_defaultClientScript" content="JavaScript"><BR> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie3-2nav3-0"><BR> </HEAD><BR> <body MS_POSITIONING="FlowLayout"><BR> <form id="Form1" method="post" runat="server"><BR> <P><BR> <asp:TextBox id="TextBox1" runat="server"></asp:TextBox></P><BR> <P><BR> <asp:TextBox id="TextBox2" runat="server"></asp:TextBox></P><BR> <P><BR> <asp:Button id="Button1" runat="server" Text="Button" OnClick="btnAddtoCart_click"></asp:Button></P><BR> </form><BR> </body><BR></HTML><BR><BR>[form.aspx.vb]<BR>Public Class form<BR> Inherits System.Web.UI.Page<BR> Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox<BR> Protected WithEvents TextBox2 As System.Web.UI.WebControls.TextBox<BR> Protected WithEvents Button1 As System.Web.UI.WebControls.Button<BR><BR>#Region " Web Form Designer Generated Code "<BR><BR> 'This call is required by the Web Form Designer.<BR> <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()<BR><BR> End Sub<BR><BR> Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init<BR> 'CODEGEN: This method call is required by the Web Form Designer<BR> 'Do not modify it using the code editor.<BR> InitializeComponent()<BR> End Sub<BR><BR>#End Region<BR><BR> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)<BR> 'Put user code to initialize the page here<BR> End Sub<BR><BR> Public Sub btnAddtoCart_click(ByVal sender As System.Object, ByVal e As System.EventArgs)<BR> 'somthing<BR> End Sub<BR>End Class
 
Back
Top