CustomControl Losing Events.

Discussion in 'ASP .Net' started by Ashish, May 22, 2006.

  1. Ashish

    Ashish Guest

    HI all,
    I have been battling with this problem with some time now, now iam out
    of ideas what to do
    basically iam planning a tab control in which page developers can define
    tab abd tabelements on the page, and i can render a table with one row
    being link buttons and second row with tabelements..

    tha markup of the control looks like

    <uc:TabStrip ID="tbMatrixProduct" runat="server">
    <uc:TabElement ID="teGeneral" runat="server" Description="General">
    <uc:GeneralProduct ID="GeneralProduct1" runat="server" />
    </uc:TabElement>
    <uc:TabElement ID="teDescription" runat="server"
    Description="Description">
    <uc:productDescription ID="ProductDescription1" runat="server" />
    </uc:TabElement>
    </uc:TabStrip>

    i have two controls with tabcontrol having ParseChildren Attribute, and
    having a ControlBuilder defined for TabElement.

    The RenderChildControl method looks like


    protected override void CreateChildControls()
    {

    Controls.Clear();
    Table cTable = new Table();
    cTable.ID = "tbl" + this.ID;

    cTable.Rows.Add(new TableRow());
    //create link button row and add a link button for each tab
    double width = Math.Floor((double)100 / (Elements.Count+1));

    foreach(TabElement element in mElements)
    {
    //create link buttons here
    }

    TableCell panelcell = new TableCell();
    panelcell.ColumnSpan = mElements.Count +1 ;
    panelcell.Width = new Unit( "100%");

    // create tabelements controls here
    foreach (TabElement element in mElements)
    {
    Panel holder = new Panel();
    holder.ID = "pnl" + element.ID;
    holder.Controls.Add(element);
    holder.Visible = (VisibleTabId == element.ID);
    panelcell.Controls.Add(holder);
    }


    so far so good, everything comes up just fine, but one of the
    usercontrols in tabelements is having nested datalist..., thats where
    thr trouble begins...

    the child datalist is having link buttons, and their event handlers
    never get called ...

    I can put the user control on the page and it works fine, but when i put
    it on my TabControl, it stops firing events...

    I have tried wiring up events on the markup, in the code behind
    everywhere, but the events dont get called.


    I can confirm that the usercontrol is not loading the entire datalists
    on the post back, but i dont know why, and how can i make it..., i can
    post the whole code if someone is interested in looking at the problem...

    thanks
    Ashish, May 22, 2006
    #1
    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. Eric B
    Replies:
    1
    Views:
    1,886
    Eric B
    Sep 3, 2003
  2. KMILO
    Replies:
    0
    Views:
    375
    KMILO
    Apr 22, 2005
  3. philipp

    writing a customControl

    philipp, May 17, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    395
    philipp
    May 18, 2005
  4. =?Utf-8?B?U3RldmU=?=

    ImageButton Click Event in CustomControl

    =?Utf-8?B?U3RldmU=?=, Feb 20, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    917
    =?Utf-8?B?U3RldmU=?=
    Feb 20, 2006
  5. Jason C
    Replies:
    4
    Views:
    681
    Morty Abzug
    Jun 26, 2012
Loading...

Share This Page