我正在爲Accordion控件動態添加手風琴窗格。當我添加一個窗格,沒有問題,但在嘗試添加第二個窗格中我得到異常:多個控件使用相同的ID「_content」發現Ajax Accordion - 發現了具有相同ID'_content'的多個控件
我試圖窗格分配唯一的ID但如下不是快樂。任何人都可以幫忙嗎?
謝謝
Rob。
if (User.IsInRole(@"arcpet\RDLM – Tradecapture Initial Margin Users – Security"))
{用於窗格 AccordionPane pneTCaptureInitalMargin =新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("Run 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);
}
你應該給自己一些正確答案的功勞!這也解決了我的頭痛:) – clamchoda 2012-02-21 15:24:15