Events not firing in codebehind, WebControl designer problem

Discussion in 'ASP .Net Web Controls' started by kw, Jul 12, 2004.

  1. kw

    kw Guest

    I have a Microsoft.Web.UI.WebControls.TabStrip and a
    Microsoft.Web.UI.WebControls.MultiPage. On the MultiPage are a few
    pageviews. On each pageview is a System.Web.UI.WebControls.LinkButton.

    Because the LinkButton's are inside the MultiPage, they don't appear in
    codebehind. So I added them manually, ie:

    protected System.Web.UI.WebControls.LinkButton _SearchByX;
    and added:



    private void InitializeComponent(){
    this.Load += new System.EventHandler(this.Page_Load);
    this._SearchByX.Click+=new EventHandler(_SearchByX_Click);

    and finally:

    private void _SearchByX_Click(object sender, EventArgs e){
    Debug.Writeline("event fired");

    So, I run the web app and go to the form containing this usercontrol. I
    click on the 'Search' button (_SearchByX) and neither the page load fires
    nor the event.

    Any clues why this happens?



    Thanks!
    kw, Jul 12, 2004
    #1
    1. Advertising

  2. kw

    kw Guest

    I forgot to add that the web control containing the multipage is loaded
    dynamically...if that matters.
    AssrSearch.Controls.Add(this.LoadControl(@"~\UI\SearchX.ascx"));


    > I have a Microsoft.Web.UI.WebControls.TabStrip and a
    > Microsoft.Web.UI.WebControls.MultiPage. On the MultiPage are a few
    > pageviews. On each pageview is a System.Web.UI.WebControls.LinkButton.
    >
    > Because the LinkButton's are inside the MultiPage, they don't appear in
    > codebehind. So I added them manually, ie:
    >
    > protected System.Web.UI.WebControls.LinkButton _SearchByX;
    > and added:
    >
    >
    >
    > private void InitializeComponent(){
    > this.Load += new System.EventHandler(this.Page_Load);
    > this._SearchByX.Click+=new EventHandler(_SearchByX_Click);
    >
    > and finally:
    >
    > private void _SearchByX_Click(object sender, EventArgs e){
    > Debug.Writeline("event fired");
    >
    > So, I run the web app and go to the form containing this usercontrol. I
    > click on the 'Search' button (_SearchByX) and neither the page load fires
    > nor the event.
    >
    > Any clues why this happens?
    >
    >
    >
    > Thanks!
    >
    >
    >
    >
    kw, Jul 12, 2004
    #2
    1. Advertising

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. Mark Rae
    Replies:
    3
    Views:
    560
    =?Utf-8?B?amlt?=
    Sep 24, 2005
  2. =?Utf-8?B?RGVtZXRyaQ==?=

    WebControl Click Event Not Firing

    =?Utf-8?B?RGVtZXRyaQ==?=, Jan 5, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    811
    =?Utf-8?B?RGVtZXRyaQ==?=
    Jan 5, 2006
  3. SevDer
    Replies:
    2
    Views:
    1,285
    Walter Wang [MSFT]
    Nov 13, 2007
  4. Todd Lucas via .NET 247

    WebControl Designer Problem using Custom Collection

    Todd Lucas via .NET 247, May 13, 2004, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    191
    BMukes
    May 28, 2004
  5. Kasabaarde Sumta

    WebControl inside of WebControl and attaching events

    Kasabaarde Sumta, Dec 13, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    174
    Kasabaarde Sumta
    Dec 13, 2004
Loading...

Share This Page