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*******@gene lco.com> wrote in message news:%2******** ********@TK2MSF TNGP14.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="handle AddEventButton" />
Created a sub to handle the event in the code behind file.
Public Sub handleAddEventB utton()
...
End Sub
I initially got an error saying that the signature of the handler wasn't correct.
Error 1 Method 'Public Sub handleAddEventB utton()' does not have the same signature as delegate 'Delegate Sub EventHandler(se nder As Object, e As System.EventArg s)'. C:\Inetpub\wwwr oot\GW300\Websi te\CalendarEven ts.aspx 53
I modified the sub as follows and all works well.
Public Sub handleAddEventB utton(ByVal sender As Object, ByVal e As System.EventArg s)
...
End Sub
Thanks again for your help Tony. I really appreciate your time and attention to my issue.
"Anthony Merante" <so**********@c ommunity.nospam > wrote in message news:eM******** ******@TK2MSFTN GP11.phx.gbl...
Do a Find and see if there is another button hidden in a region er something.
"Ken Sturgeon" <ks*******@gene lco.com> wrote in message news:Ou******** ******@tk2msftn gp13.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.W ebControls.Butt on' 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="Left ToRight" Visible="False" >
<hr />
<table>
<tr>
<td colspan="2" class="TableHea der"><font class="TableHea derFont">Add Event</font></td>
</tr>
<tr>
<td><asp:Hidden Field ID="hidNewEvent ID" runat="server" Value="" />
<asp:Label ID="lblNewEvent Date" runat="server"> Date:</asp:Label></td>
<td style="width: 207px"><asp:Tex tBox ID="txtNewEvent Date" runat="server" /></td>
</tr>
<tr>
<td><asp:Labe l ID="lblNewEvent Title" runat="server"> Title:</asp:Label></td>
<td style="width: 207px"><asp:Tex tBox ID="txtNewEvent Title" Width="200" MaxLength="60" runat="server" /></td>
</tr>
<tr>
<td><asp:Labe l ID="lblNewEvent Desc" runat="server"> Description:</asp:Label></td>
<td style="width: 207px"><asp:Tex tBox ID="txtNewEvent Desc" 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**********@c ommunity.nospam > wrote in message news:OF******** ******@TK2MSFTN GP14.phx.gbl...
Hmm Im not a VB guy but have you declared btnAddEvent like:
Protected WithEvents btnAddEvent As System.Web.UI.W ebControls.Butt on ?
"Ken Sturgeon" <ks*******@gene lco.com> wrote in message news:%2******** ********@TK2MSF TNGP11.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_Cli ck1(ByVal sender As Object, ByVal e As System.EventArg s) Handles btnAddEvent.Cli ck
handleAddEventB utton()
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**********@c ommunity.nospam > wrote in message news:%2******** ********@TK2MSF TNGP09.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*******@gene lco.com> wrote in message
news:%2******** ********@tk2msf tngp13.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