Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

How do I add an image button to a tab on a AJAX TabControl dynamically at runtime

$
0
0

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 Tab

TabContainer1.Tabs.Add(tabPanel); // Add Tab to Tab Container

Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>