How do I add an image button to a tab dynamically at runtime so that it replicates the codebehind version :-
<
ajaxToolkit:TabPanelrunat="server"ID="tabA"HeaderText=""><HeaderTemplate><asp:ImageButtonrunat="server"ID="refreshTabA"ImageUrl="./img/Refresh.gif"OnClick="refreshTabA_OnClick"/><spanstyle="">Tab A</span></HeaderTemplate>
I am building my Tabs on my TabControl dynamically and in each of the tabs I have a ReportViewer control. (So I can display multiple reports on a page 1 tab per report), this bit works ok which adds the tab and the tab title and the report, just the image button on the tab I'm missing.
TabPanel tabPanel = newTabPanel(); // Create Tab dynanically
tabPanel.ID =
"tab"+ ReportName;tabPanel.HeaderText = DisplayName;
ReportViewer reportViewer =newReportViewer(); // Create report
tabPanel.Controls.Add(reportViewer); // Add report dynamically to TabTabContainer1.Tabs.Add(tabPanel); // Add Tab to Tab Container