Depends what you want to do.
For controls/text I normally use a LiteralControl
and set the Text
property as the HTML I want to add, then this control can be added anywhere on the page that you want it to appear
LiteralControl reference is
here
ok seeing as you want it for Galleriffic, I guess it would pseudo-appear as such...
LiteralControl imageGallery = new LiteralControl();
string divStart = @"<div id='thumbs'><ul class='thumbs noscript'>";
imageGallery.Text += divStart;
foreach ([image in images])
{
string imageHTML = @"<li><a class='thumb' name='optionalCustomIdentifier' ref='path/to/slide' title='your image title'>
<img src='path/to/thumbnail' alt='your image title again for graceful degradation' /></a>
<div class='caption'>[caption]<div></li>";
imageGallery.Text += imageHTML;
}
string divEnd = @"</ul></div>";
imageGallery.Text += divEnd;
this.[divOnPage].Controls.Add(imageGallery);