Welcome! and rules
Joel on Software
ASP.NET : inserting HTML into response output
I want to write some HTML into my current ASPX page, runtime. For e.g. I want to add a html map attribute to the page - if I try itusing Response.Write - it writes it to the top of the output, even before the HTML tags are formed. How do I write it so that the final output HTML actually has my insert "within it", preferably in the end of file before the html tags end.
One approach is to add a label or panel to the .aspx page and your html to that.
This is what the PlaceHolder control is for.
> This is what the PlaceHolder control is for.
I figured the literal control was the best way to do it - so I used that. Placeholders have a different "place", usually for loading user controls into a specific place. That wasn't what I was looking for.
Yep - I stand humbly corrected. :)
I find an easy way to accomplish this is to add an id and and runat="server" to the HTML tag that I want contain dynamic content. This way I know what the markup around it is going to be and as a result it seems easier to style it using CSS.
Fog Creek Home