[Resolved] Dynamic control - Style
Hi all,
I am working with a custom tab control which can add tabs dynamically. For this my control uses <div> to each tag. At design time my div tag is like this:
<div id="divTab1" style="DISPLAY:none">
In this case it works fine. Where as when I am generating the div dynamically using the following code, there is a visibility problem with the tab. I tested the page by removing style="DISPLAY:none" from my design time div tag and it shows the same problem.
foreach (string tabNm in tmpClass.strArray)
{
System.Web.UI.HtmlControls.HtmlGenericControl myDiv;
myDiv = new HtmlGenericControl("div");
myDiv.ID = "div" + tabTitle;
this.Controls.Add(myDiv);
}
How can i give style="DISPLAY:none" when I am generating the div dynamically?
Re: Dynamic control - Style
You could do this
Code:
myDiv.Attributes.Add("style", "DISPLAY:none");
Re: Dynamic control - Style
wow cool stuf... it works fine... thanks fishcake