Karen, you need to add the event handler to the event.  This is done in the Page_Load 
event and will look something like this:

this.btnAddRecord.Click += new System.EventHandler(this.btnAddRecord_Click);

It's often in code hidden in a region called "Web Form Designer generated code" in the 
code behind but can also be in your ASPX.  

Why aren't you using codebehinds?  You are almost always better off with them.

Greg Ewing [MVP]
www.citidc.com


Original Message:
>From: Karen Kungowski <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: [AspNetAnyQuestionIsOk] Button Click Event doesn't fire on page with no 
>code-behind
>Date: Tue, 25 May 2004 07:45:22 -0700 (PDT)

>This is at the top:
>
><%@ Import Namespace="System.Data.OLEDB" %>
><%@ Page trace="false" debug="true"
>smartNavigation="False" %>
>
>Here is the HTML:
>
>                       <asp:Button id="btnAddRecord" runat="server"
>BorderStyle="Outset" Text="Add"></asp:Button>
>
>
>Here is the event:
>
>Sub btnAddRecord_Click(ByVal sender As System.Object,
>ByVal e As System.EventArgs)
>
>            Dim t1 As TextBox =
>FindControl("DanceStyle")
>            Dim t2 As TextBox =
>FindControl("DanceStyleWebPage")
>
>    strSQL = "INSERT INTO
>tblDanceStyles(DanceStyle,DanceStyleWebpage) VALUES('"
>& t1.Text & "','" & t2.Text & "')"
>    
>    Cmd = New OLEDBCommand(strSQL, Conn)
>    
>    Conn = New
>OLEDBConnection(fUseThisConnection(Server.MachineName))
>           
>    Conn.Open()
>    Cmd.ExecuteNonQuery()
>    Cmd.Dispose()
>    Conn.Close()
>       BindDataGrid()
>       
>   End Sub
>
>
>       
>               
>__________________________________
>Do you Yahoo!?
>Friends.  Fun.  Try the all-new Yahoo! Messenger.
>http://messenger.yahoo.com/ 
>
>
>
> 
>Yahoo! Groups Links
>
>
>
> 
>
>
>




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
     [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 

Reply via email to