<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://rayharwood.com/Wiki/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://rayharwood.com/Wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=75.174.205.217&amp;*</id>
		<title>RayHarwood - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://rayharwood.com/Wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=75.174.205.217&amp;*"/>
		<link rel="alternate" type="text/html" href="http://rayharwood.com/Wiki/index.php?title=Special:Contributions/75.174.205.217"/>
		<updated>2026-11-06T07:19:28Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.20.3</generator>

	<entry>
		<id>http://rayharwood.com/Wiki/index.php?title=Writing_HTML_to_a_String</id>
		<title>Writing HTML to a String</title>
		<link rel="alternate" type="text/html" href="http://rayharwood.com/Wiki/index.php?title=Writing_HTML_to_a_String"/>
				<updated>2013-10-06T18:07:40Z</updated>
		
		<summary type="html">&lt;p&gt;75.174.205.217: Created page with &amp;quot;If you want to be able to populate a Panel or otherwise generate HTML to a string, it's complex, but straightforward.  Bring in the following references to your class and proj...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you want to be able to populate a Panel or otherwise generate HTML to a string, it's complex, but straightforward.&lt;br /&gt;
&lt;br /&gt;
Bring in the following references to your class and project:&lt;br /&gt;
&lt;br /&gt;
        Imports System.Web.UI&lt;br /&gt;
        Imports System.Text&lt;br /&gt;
&lt;br /&gt;
Get your data from your dataset:&lt;br /&gt;
&lt;br /&gt;
        Dim Content_DT As ClixMKP_DataSet.ContentDataTable = Content_TA.GetDataForSiteAbbrev(SiteAbbrev)&lt;br /&gt;
&lt;br /&gt;
Now declare a StringBuilder, a StringWriter, and an HTMLTextWriter, each one based on the previous item:&lt;br /&gt;
&lt;br /&gt;
        Dim SB As New Text.StringBuilder&lt;br /&gt;
        Dim SW As IO.TextWriter = New IO.StringWriter(SB)&lt;br /&gt;
        Dim HTML As New System.Web.UI.HtmlTextWriter(SW)&lt;br /&gt;
&lt;br /&gt;
Start the rendering process:&lt;br /&gt;
&lt;br /&gt;
        HTML.BeginRender()&lt;br /&gt;
&lt;br /&gt;
Now loop through the records in your data table, one record at a time.  In this case, I'm generating three paragraphs.  Note that in order to generate attributes and style entries, you have to &amp;quot;add&amp;quot; those '''before''' the actual begin tag.&lt;br /&gt;
&lt;br /&gt;
        For Each Content_Rec As ClixMKP_DataSet.ContentRow In Content_DT.Rows&lt;br /&gt;
            HTML.AddStyleAttribute(&amp;quot;color&amp;quot;, &amp;quot;Blue&amp;quot;)&lt;br /&gt;
            HTML.AddStyleAttribute(&amp;quot;font-weight&amp;quot;, &amp;quot;Bolder&amp;quot;)&lt;br /&gt;
            HTML.AddStyleAttribute(&amp;quot;font-size&amp;quot;, &amp;quot;Larger&amp;quot;)&lt;br /&gt;
            HTML.RenderBeginTag(HtmlTextWriterTag.P)&lt;br /&gt;
            HTML.Write(Content_Rec.ContentHeader)&lt;br /&gt;
            HTML.RenderEndTag()&lt;br /&gt;
            '&lt;br /&gt;
            HTML.AddStyleAttribute(&amp;quot;padding&amp;quot;, &amp;quot;20px&amp;quot;)&lt;br /&gt;
            HTML.RenderBeginTag(HtmlTextWriterTag.P)&lt;br /&gt;
            HTML.Write(Content_Rec.ContentHTML)&lt;br /&gt;
            HTML.RenderEndTag()&lt;br /&gt;
            '&lt;br /&gt;
            HTML.AddStyleAttribute(&amp;quot;text-decoration&amp;quot;, &amp;quot;italic&amp;quot;)&lt;br /&gt;
            HTML.RenderBeginTag(HtmlTextWriterTag.P)&lt;br /&gt;
            HTML.AddAttribute(&amp;quot;href&amp;quot;, Content_Rec.ContentLinkURL)&lt;br /&gt;
            HTML.AddAttribute(&amp;quot;target&amp;quot;, &amp;quot;_blank&amp;quot;)&lt;br /&gt;
            HTML.RenderBeginTag(HtmlTextWriterTag.A)&lt;br /&gt;
            HTML.Write(&amp;quot;Click for more...&amp;quot;)&lt;br /&gt;
            HTML.RenderEndTag()&lt;br /&gt;
            HTML.RenderEndTag()&lt;br /&gt;
            '&lt;br /&gt;
        Next&lt;br /&gt;
&lt;br /&gt;
Now finish the rendering:&lt;br /&gt;
&lt;br /&gt;
        HTML.EndRender()&lt;br /&gt;
&lt;br /&gt;
And finally, generate the text:&lt;br /&gt;
&lt;br /&gt;
        Dim ReturnHTML As String = &amp;quot;&amp;quot;&lt;br /&gt;
        ReturnHTML = SB.ToString&lt;/div&gt;</summary>
		<author><name>75.174.205.217</name></author>	</entry>

	<entry>
		<id>http://rayharwood.com/Wiki/index.php?title=VB_Code_Snippets</id>
		<title>VB Code Snippets</title>
		<link rel="alternate" type="text/html" href="http://rayharwood.com/Wiki/index.php?title=VB_Code_Snippets"/>
				<updated>2013-10-06T17:59:59Z</updated>
		
		<summary type="html">&lt;p&gt;75.174.205.217: HTML to a String - added&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Batch Mode and Command-Line Arguments]]&lt;br /&gt;
&lt;br /&gt;
[[Changing Font on a TreeNode]]&lt;br /&gt;
&lt;br /&gt;
[[Connection String manipulation]]&lt;br /&gt;
&lt;br /&gt;
[[Create an SQL Command from an existing Table Adapter]] - Example: Truncate Table&lt;br /&gt;
&lt;br /&gt;
[[Filter a DataGridView with TextBox]]&lt;br /&gt;
&lt;br /&gt;
[[Format a DatagridView row/cell based on data value]]&lt;br /&gt;
&lt;br /&gt;
[[Logging Activities to a Text Box]]&lt;br /&gt;
&lt;br /&gt;
[[Marshalling updates to a text box]]&lt;br /&gt;
&lt;br /&gt;
[[Open File Dialog]]&lt;br /&gt;
&lt;br /&gt;
[[Processing an input file in Excel]]&lt;br /&gt;
&lt;br /&gt;
[[Relaxing Enforced Constraints]]&lt;br /&gt;
&lt;br /&gt;
[[Updating DataTable]]&lt;br /&gt;
&lt;br /&gt;
[[Version Number String]]&lt;br /&gt;
&lt;br /&gt;
[[Writing HTML to a String]]&lt;/div&gt;</summary>
		<author><name>75.174.205.217</name></author>	</entry>

	</feed>