<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CM &#187; ASP.NET</title>
	<atom:link href="http://corymathews.com/tag/aspnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://corymathews.com</link>
	<description>Things I should remember and then some...</description>
	<lastBuildDate>Fri, 04 May 2012 16:56:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Input Data to Display Newlines in ASP.NET</title>
		<link>http://corymathews.com/input-data-to-display-newlines-in-aspnet/</link>
		<comments>http://corymathews.com/input-data-to-display-newlines-in-aspnet/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 16:13:49 +0000</pubDate>
		<dc:creator>CoryMathews</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C Sharp]]></category>

		<guid isPermaLink="false">http://corymathews.com/?p=229</guid>
		<description><![CDATA[In asp.net input taken from a plain text box will not display newline characters (Hitting the enter key) when outputting to the browser. So for example you have a text box that users can input text into, they put a couple paragraphs in it and submit that data to the database. If you just strait [...]]]></description>
			<content:encoded><![CDATA[<p>In asp.net input taken from a plain text box will not display newline characters (Hitting the enter key) when outputting to the browser.</p>
<p>So for example you have a text box that users can input text into, they put a couple paragraphs in it and submit that data to the database. If you just strait output the content to the browser you will see one giant blob of text. So how can you fix this?</p>
<p>By converting the newline to a html<br />
tag we can fix the problem. So with a little c# function we have the trick done.</p>
<pre class="c#">public String FixLabelOutput(String val) {
    return val.Replace(Environment.NewLine, "&lt;br /&gt;");
}</pre>
<p>As you see our function simple returns all newlines as &lt;br /&gt; which will fix the way it is outputted.</p>
<p>In the aspx page you need to have this to display the corrected text. This of course can be placed in a label or just strait printed.</p>
<pre class="vb">&lt;%# FormatHtml(Eval("TextInfo").ToString()) %&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://corymathews.com/input-data-to-display-newlines-in-aspnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

