wtbonnell Posted September 5, 2004 Posted September 5, 2004 I am using Asp.Net (w/ C#) and I am dynamically generating a stringbuilder to create html code. My question is, how do you control where the code goes on the .aspx page when using Response.Write(htmlStringContent). Currently the info just appears at the top of the page and I want it to appear within a column (<td></td>) that I already have established as a holder. Thanks Quote
Administrators PlausiblyDamp Posted September 5, 2004 Administrators Posted September 5, 2004 Rather than using the response object you will probably be better of placing a literal control where you require the HTML to be and then assign the result of the string builder to that. Out of curiosity what does this html string contain as there may be built in controls that require less effort than building your own html. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
wtbonnell Posted September 5, 2004 Author Posted September 5, 2004 The html string will have just a table with one row and two columns. In each column will have <a href> tags <table> <tr> <td> <a href='someDynamicData'>moreDynamicData</a> <\td> <\tr> </table> By the way, do you have an example of using literal controls? I am relatively new to .net? Thanks Quote
Administrators PlausiblyDamp Posted September 5, 2004 Administrators Posted September 5, 2004 the html would look like </pre><table> </tabl and the code behind would be Literal1.Text = " moreDynamicData" However if you just want a simple link you may be better of with a HyperLink control </pre><table> HyperLink </tabl with a code behind like HyperLink1.Text = "moreDynamicData" HyperLink1.NavigateUrl = "http://www.b3ta.com" 'or wherever Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
wtbonnell Posted September 5, 2004 Author Posted September 5, 2004 that worked perfect! thanks for all your help! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.