M
Mike Dinnis
I know it's probably my code but I don't seem to be able to get OnClick
events to tie up. The OnLoad and other standard events will fire but not a
button onclick. Here's a sample of what i'm trying to do..
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="newhist.aspx.vb"
Inherits="History.newhist"%>
<HTML>
<HEAD>
<LINK href="Styles.css" type="text/css" rel="STYLESHEET">
</HEAD>
<BODY>
<form id="frmNewHistory" method="post" runat="server">
<asp:TextBox id="txtWork" runat="server" Width="240px"
Height="112px"></asp:TextBox>
<asp:Button id="cmdEnter" runat="server" Text="Enter"
OnClick="EnterData"></asp:Button>
</form>
</BODY>
</HTML>
using the code behind of...
Public Class newhist
Inherits System.Web.UI.Page
Protected WithEvents txtWork As System.Web.UI.WebControls.TextBox
Protected WithEvents cmdEnter As System.Web.UI.WebControls.Button
Public Sub EnterData(ByVal Sender As Object, ByVal e As EventArgs)
Handles cmdEnter.Click
Dim obHistory As New History.History
obHistory.AddHistory(txtWork.Text)
txtWork.Text = "Done"
End Sub
End Class
The error I get is "Compiler Error Message: BC30456: 'EnterData' is not a
member of 'ASP.newhist_aspx'."
Is there anything obvious that i'm doing wrong?
Cheers,
<M>ike
events to tie up. The OnLoad and other standard events will fire but not a
button onclick. Here's a sample of what i'm trying to do..
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="newhist.aspx.vb"
Inherits="History.newhist"%>
<HTML>
<HEAD>
<LINK href="Styles.css" type="text/css" rel="STYLESHEET">
</HEAD>
<BODY>
<form id="frmNewHistory" method="post" runat="server">
<asp:TextBox id="txtWork" runat="server" Width="240px"
Height="112px"></asp:TextBox>
<asp:Button id="cmdEnter" runat="server" Text="Enter"
OnClick="EnterData"></asp:Button>
</form>
</BODY>
</HTML>
using the code behind of...
Public Class newhist
Inherits System.Web.UI.Page
Protected WithEvents txtWork As System.Web.UI.WebControls.TextBox
Protected WithEvents cmdEnter As System.Web.UI.WebControls.Button
Public Sub EnterData(ByVal Sender As Object, ByVal e As EventArgs)
Handles cmdEnter.Click
Dim obHistory As New History.History
obHistory.AddHistory(txtWork.Text)
txtWork.Text = "Done"
End Sub
End Class
The error I get is "Compiler Error Message: BC30456: 'EnterData' is not a
member of 'ASP.newhist_aspx'."
Is there anything obvious that i'm doing wrong?
Cheers,
<M>ike