hehe Cool! Yea i guess i should have asked if you had the button wired up!
Glad to have been of some "help"
"Ken Sturgeon" <ks*******@genelco.com> wrote in message news:%2****************@TK2MSFTNGP14.phx.gbl...
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.as px 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.
"Anthony Merante" <so**********@community.nospam> wrote in message news:eM**************@TK2MSFTNGP11.phx.gbl...
Do a Find and see if there is another button hidden in a region er something.
"Ken Sturgeon" <ks*******@genelco.com> wrote in message news:Ou**************@tk2msftngp13.phx.gbl...
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:Panel 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:Panel>
"Anthony Merante" <so**********@community.nospam> wrote in message news:OF**************@TK2MSFTNGP14.phx.gbl...
Hmm Im not a VB guy but have you declared btnAddEvent like:
Protected WithEvents btnAddEvent As System.Web.UI.WebControls.Button ?
"Ken Sturgeon" <ks*******@genelco.com> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl...
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.
"Anthony Merante" <so**********@community.nospam> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl...
You should be able to. You'd capture the event the same as if the button was
not in the panel.
You most likely have something else going on in the page life cycle thats
causing you to lose the click event.
-Tony
"Ken Sturgeon" <ks*******@genelco.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...I have a button inside a panel control. Apparently I can't expect VB to
respond to the button's _Click event. How do I capture the click event?
Thanks
Ken