UserControl - Doesn't fire child events

Discussion in 'ASP .Net Web Controls' started by Q Dennis, Sep 20, 2004.

  1. Q Dennis

    Q Dennis Guest

    Hi,

    I have a user simple usercontrol with a button, created with VS2005, the
    Load event fires but the Button event doesn't.

    <%@ Control Language="VB" AutoEventWireup="false"
    CompileWith="WebUserControl.ascx.vb" ClassName="WebUserControl_ascx" %>
    <asp:Button ID="Button1" Runat="server" Text="Button" />

    +=================================================

    Partial Class WebUserControl_ascx

    Private Sub Page_Load(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles Me.Load
    MsgBox("Load")
    End Sub

    Private Sub Button1_Click(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles Button1.Click
    MsgBox("Click")
    End Sub
     
    Q Dennis, Sep 20, 2004
    #1
    1. Advertisements

  2. I believe I am having this same problem. See my post with the subject:
    Linkbutton in User Control Not Working.

    Tony

    "Q Dennis" <> wrote in message
    news:%...
    > Hi,
    >
    > I have a user simple usercontrol with a button, created with VS2005, the
    > Load event fires but the Button event doesn't.
    >
    > <%@ Control Language="VB" AutoEventWireup="false"
    > CompileWith="WebUserControl.ascx.vb" ClassName="WebUserControl_ascx" %>
    > <asp:Button ID="Button1" Runat="server" Text="Button" />
    >
    > +=================================================
    >
    > Partial Class WebUserControl_ascx
    >
    > Private Sub Page_Load(ByVal sender As Object, ByVal e As
    > System.EventArgs) Handles Me.Load
    > MsgBox("Load")
    > End Sub
    >
    > Private Sub Button1_Click(ByVal sender As Object, ByVal e As
    > System.EventArgs) Handles Button1.Click
    > MsgBox("Click")
    > End Sub
    >
    >
     
    Anthony Hunter, Sep 20, 2004
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. KK
    Replies:
    0
    Views:
    520
  2. Neil Jarman

    DataList doesn't fire events

    Neil Jarman, Aug 17, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    646
    Teemu Keiski
    Aug 20, 2005
  3. =?Utf-8?B?S2lt?=

    Dropdownlist in usercontrol doesn't fire

    =?Utf-8?B?S2lt?=, Mar 19, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    1,938
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    Mar 21, 2006
  4. Jeff Rodriguez
    Replies:
    23
    Views:
    1,565
    David Schwartz
    Dec 9, 2003
  5. Andrew2
    Replies:
    1
    Views:
    753
    Andrew2
    Jan 25, 2008
  6. KK
    Replies:
    0
    Views:
    225
  7. Mark Sisson

    What doesn't an ItemTemplate child control fire an ItemCommand??

    Mark Sisson, Dec 17, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    271
    Mark Sisson
    Dec 17, 2003
  8. KK
    Replies:
    0
    Views:
    237
Loading...