i created a new class called HTMLRenderer and i am calling it from my aspx view code
namespace Golf.Content
{
public static class HtmlRenderer
{
public static void RenderHtmlPage(HtmlHelper helper_, string path_)
{
var reader = new StreamReader(path_);
var contents = reader.ReadToEnd();
helper_.ViewContext.HttpContext.Response.Write(contents);
}
}
}
and i am using it
<% HtmlRenderer.RenderHtmlPage(Html, Server.MapPath("http://www.salemgolfclub.org/Members/newletters/welcome.html" ) ); %>
and i get the error
d:\Adam\Code\CSharp\Asp.net\Adam\Views\Home\Index.aspx(2): error CS0234: The type or namespace name ‘Content’ does not exist in the namespace ‘Golf’ (are you missing an assembly reference?)
The build compiles and the Content namespace DOES exist?
any suggestions on whats going wrong here
You can also add it to web.config so you don’t have to add it to every page. This post talks about registering controls http://haacked.com/archive/2006/11/14/Register_Custom_Controls_In_Web.config.aspx
but namespaces work in a similar way. Just use the section instead of controls.