[RESOLVED] HtmlTable - Creating Dynamically
I am creating an HtmlTable object dynamically at runtime and adding it to a PlaceHolder controls collection. All is well, except for the fact that I do not have a CssClass property. I need to specify this so that it picks up the style and looks like all other tables in my project.
Any ideas?
Re: HtmlTable - Creating Dynamically
Ah...don't worry. I have solved it by using the Web Control Table object that has a CssClass property.
Re: [RESOLVED] HtmlTable - Creating Dynamically
You could have done
.Attributes.Add("class","classname")
Re: [RESOLVED] HtmlTable - Creating Dynamically
Really? Oh well...
Also, I wasn't able to embed html tables within cells of other tables either, which I am able to do with the table web object so I guess I am better off using these anyway...
Re: [RESOLVED] HtmlTable - Creating Dynamically
You sure can do that as well. How were you attempting it originally, if you remember?
Re: [RESOLVED] HtmlTable - Creating Dynamically
Quote:
Originally Posted by mendhak
You sure can do that as well. How were you attempting it originally, if you remember?
You can't do it dynamically in code. Or at least, I was gettig a Stack overflow error when I tried to insert an HtmlTable into a HtmlTableCell's controls collection.
I really don't have the time to go into it in more detail now. It doesn't matter anyway because I've got it working fine using the Table Web Component...