|
-
May 31st, 2007, 07:45 PM
#1
Thread Starter
Lively Member
[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?
Last edited by kiran_q8; Jun 1st, 2007 at 12:03 PM.
-
Jun 1st, 2007, 05:55 AM
#2
Re: Dynamic control - Style
You could do this
Code:
myDiv.Attributes.Add("style", "DISPLAY:none");
-
Jun 1st, 2007, 11:58 AM
#3
Thread Starter
Lively Member
Re: Dynamic control - Style
wow cool stuf... it works fine... thanks fishcake
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|