1

I'm working on a project, converting a javascript based website into an ASP.Net and C# based website. I have several instances of hard coded AJAX Control Toolkit Tabs. I have to on page load, and on button click, add and remove tabs to these tab containers.

I've found many options to create the tabcontainer itself onload, and then add tabs and the html and so on. But is there any way in which I can access the hard coded Tab Container, and add and remove tabs to it?

I was thinking specifically, is there a C# equivalent to the Javascript getElementById() function? Would it work in such a situation?

Duncan McKirdy
  • 141
  • 1
  • 12

1 Answers1

1

Discovered the answer.

Reference your tabcontainer's id, for example if your tab container is hard coded with the id tabTabOne you would write.

tabTabOne.AutoPostBack = true;

AjaxControlToolkit.TabPanel t = new AjaxControlToolkit.TabPanel();
t.ID = "tabTabPanel3";
t.HeaderText = "Panel 3";
tabTabOne.Tabs.Add(t);

This will add a panel to the Container whose id you're using.

Duncan McKirdy
  • 141
  • 1
  • 12