# How to show the ASP.NET code file

Use a simple function, which will show the text of the file. You will need the pass the path of the file to the function. This path should be the absolute path and hence you should use the Server.MapPath while calling this function.

Here is the code to the work

 protected string GetCode(string filename)
{
StringBuilder sb = new StringBuilder();
sb.Append("&lt;code&gt;&lt;pre&gt;");
}