C# Function Similar to PHP Eval()
<p>I'm looking for a way to display code snippets stored in a database on a webpage with .NET and C# and I saw the exact function that I was looking for a while back, but I cannot remember what search terms I used or the name of the C# function that designed to do that specifically. </p>

<p>Essentially, it's a C# version of PHP's Eval() function, so I can render code examples that I've collected over the years and see the end result as well as the actual source code. I'm sure that this has already been asked, but I couldn't find what I was looking for when I looked through the existing questions on here. </p>

<p>This will be a password protected page on my site for my eyes only (theoretically, at least), so I'm not overly concerned about someone running malicious code. But I appreciate the kind warnings that some may feel obliged to offer before answering my question. Seriously, I do.</p>

<p>I have a feeling that about 10 people will see this question and go, "well, obviously it's (Insert Function Name Here), you silly wabbit." So this is my way of admitting my shame of not knowing right here, up front. Especially when I just saw it like a <strong><em>week</em></strong> ago. </p>

<p>Thanks in advance!
Paul</p>

<hr>

<p>Addendum: I found the following code and it works like a charm on HTML, JS &amp; CSS. Since I've only been working with C# for a few months, I don't have a lot of C# code to render so it works quite well.</p>

<pre><code>String EncodedString = rs["Code"].ToString();
StringWriter writer = new StringWriter();
Server.HtmlDecode(EncodedString, writer);
String DecodedString = writer.ToString();
codeDecoded.Text = DecodedString;
</code></pre>
