hehe Cool! Yea i guess i should have asked if you had the button wired up!
Glad to have been of some "help"
I finally got past the issue Tony.
I modified the line in the aspx page where the button is created by adding the OnClick event there.
<asp:Button ID="btnAddEvent" runat="server" text="Add Event" OnClick="handleAddEventButton" />
Created a sub to handle the event in the code behind file.
Public Sub handleAddEventButton()
...
End Sub
I initially got an error saying that the signature of the handler wasn't correct.
Error 1 Method 'Public Sub handleAddEventButton()' does not have the same signature as delegate 'Delegate Sub EventHandler(sender As Object, e As System.EventArgs)'. C:\Inetpub\wwwroot\GW300\Website\CalendarEvents.aspx 53
I modified the sub as follows and all works well.
Public Sub handleAddEventButton(ByVal sender As Object, ByVal e As System.EventArgs)
...
End Sub
Thanks again for your help Tony. I really appreciate your time and attention to my issue.
Do a Find and see if there is another button hidden in a region er something.
Yes, I found a couple threads that indicated that as the solution to the error message I'm getting. When I added it I got the blue squiggly; when I hover over it it says...
btnAddEvent is already declared as 'Protected Dim WithEvents btnAddEvent As System.Web.UI.WebControls.Button' in this class
I don't see it declared anywhere else in the class. The only place it's referenced is in the aspx page where I created it.
<asp
anel ID="pnlAddEvent" runat="server" Width="100%" Direction="LeftToRight" Visible="False">
<hr />
<table>
<tr>
<td colspan="2" class="TableHeader"><font class="TableHeaderFont">Add Event</font></td>
</tr>
<tr>
<td><asp:HiddenField ID="hidNewEventID" runat="server" Value="" />
<asp:Label ID="lblNewEventDate" runat="server">Date:</asp:Label></td>
<td style="width: 207px"><asp:TextBox ID="txtNewEventDate" runat="server" /></td>
</tr>
<tr>
<td><asp:Label ID="lblNewEventTitle" runat="server">Title:</asp:Label></td>
<td style="width: 207px"><asp:TextBox ID="txtNewEventTitle" Width="200" MaxLength="60" runat="server" /></td>
</tr>
<tr>
<td><asp:Label ID="lblNewEventDesc" runat="server">Description:</asp:Label></td>
<td style="width: 207px"><asp:TextBox ID="txtNewEventDesc" Width="200" MaxLength="60" runat="server" /></td>
</tr>
<tr>
<td colspan="2" align="right"><br /><asp:Button ID="btnAddEvent" runat="server" text="Add Event" /></td>
</tr>
</table>
</asp
anel>
Hmm Im not a VB guy but have you declared btnAddEvent like:
Protected WithEvents btnAddEvent As System.Web.UI.WebControls.Button ?
I hope it's as easy as you say Tony but when I run in debug mode it won't even compile. The code for the button click event follows.
Protected Sub btnAddEvent_Click1(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAddEvent.Click
handleAddEventButton()
End Sub
I get the following error:
error BC30506: Handles clause requires a WithEvents variable defined in the containing type or one of its base types.
Thanks for your help. I do appreciate it.