开发者

Ajax Accordion - Multiple controls with the same ID '_content' were found

开发者 https://www.devze.com 2023-01-15 12:11 出处:网络
I\'m dynamically adding accordion panes to an Accordion Control. When I add a single pane, no problem but trying to add 2nd pane I get the exception: Multiple controls with the same ID \'_content\' we

I'm dynamically adding accordion panes to an Accordion Control. When I add a single pane, no problem but trying to add 2nd pane I get the exception: Multiple controls with the same ID '_content' were found

I've tried assigning unique Ids to the panes as follows but not joy. Can anyone please help?

Thanks

Rob.

if (User.IsInRole(@"arcpet\RDLM – Tradecapture Initial Margin Users – Security"))

{ //build header for pane AccordionPane pneTCaptureInitalMargin = new AccordionPane(); pneTCaptureInitalMargin.HeaderContainer.Controls.Add(new LiteralControl("(TCIM)T/Capture Initial Margin")); pneTCaptureInitalMargin.ID = "AccordionPane" + Guid.NewGuid().ToString(); pneTCaptureInitalMargin.HeaderContainer.ID = "HeaderContainer" + Guid.NewGuid().ToString();

    //build content for pane
    pneTCaptureInitalMargin = AddHyperLink("Trade Books & Markers", "TradeBook/TradeBook.aspx?4", pneTCaptureInitalMargin);
    acc.Panes.Add(pneTCaptureInitalMargin);

    pneTCaptureInitalMargin = AddHyperLink("+Create New Records", "TradeBook/TradeBookDetail.aspx?acPane=4&type=new", pneTCaptureInitalMargin);
    acc.Panes.Add(pneTCaptureInitalMargin);

    pneTCaptureInitalMargin = AddHyperLink("Bache Account Mappings", "BacheAccount/BacheAccountSettings.aspx?4", pneTCaptureInitalMargin);
    acc.Panes.Add(pneTCaptureInitalMargin);

    pneTCaptureInitalMargin = AddHyperLink("+Create New Record", "BacheAccount/BacheAccountSettingsDetail.aspx?acPane=4&type=new", pneTCaptureInitalMargin);
    acc.Panes.Add(pneTCaptureInitalMargin);

    pneTCaptureInitalMargin = AddHyperLink("开发者_如何学GoRun DI Job", "AjaxBODI.aspx?acPane=0&subject=refTradeBook", pneTCaptureInitalMargin);
    acc.Panes.Add(pneTCaptureInitalMargin);
}

if (User.IsInRole(@"arcpet\RDLM – Cash Utilisation Users – Security"))
{
    //build header for pane
    AccordionPane pneCashUtilisation = new AccordionPane();
    pneCashUtilisation.HeaderContainer.Controls.Add(new LiteralControl("(CU) Cash Utilisation"));
    pneCashUtilisation.ID = "AccordionPane" + Guid.NewGuid().ToString();
    pneCashUtilisation.HeaderContainer.ID = "HeaderContainer" + Guid.NewGuid().ToString();

    //build content for pane
    pneCashUtilisation = AddHyperLink("Trade Books & Markers", "TradeBook/TradeBook.aspx?5", pneCashUtilisation);
    acc.Panes.Add(pneCashUtilisation);

    pneCashUtilisation = AddHyperLink("+Create New Records", "TradeBook/TradeBookDetail.aspx?acPane=5&type=new", pneCashUtilisation);
    acc.Panes.Add(pneCashUtilisation);

    pneCashUtilisation = AddHyperLink("Trade Book Overheads", "TradeBook/TradeBookOverhead.aspx?5", pneCashUtilisation);
    acc.Panes.Add(pneCashUtilisation);

    pneCashUtilisation = AddHyperLink("+Create New Record", "TradeBook/TradeBookOverheadDetail.aspx?acPane=5&type=new", pneCashUtilisation);
    acc.Panes.Add(pneCashUtilisation);

    pneCashUtilisation = AddHyperLink("Run DI Job", "AjaxBODI.aspx?acPane=0&subject=refTradeBook", pneCashUtilisation);
    acc.Panes.Add(pneCashUtilisation);
}


Fixed it! Don't know why but assigning the PaneId directly after declaration (on the following line) is critical.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号