From your questions and statements you obviously know very little about ASP.NET development and it seems strange that you are trying to do some weird security with encrypting page content and using a custom web browser. Seems very drastic, why not just use ssl to secure a page like anyone else would?
You seem to expect syntax like a scripting language such as classic asp or php, asp.net is not a scripting language.
<%= is just shorthand for Response.Write. That is why it can render a string. ASP.NET is not a scripting language like Classic ASP, Reponse.Write is not typically the right way to do things in ASP.NET like it was in Classic ASP. ASP.NET WebForms is about building a control tree that does the rendering and requires understanding the lifecycle of page and control events.
The hello world article is about how to implement a custom content feature that plugs in to the cms as a UserControl, it isn't the same thing as a server control. I could write a control to do what you want in 2 minutes:
using System.Web.UI.WebControls;
namespace MyNamespace.Controls
{
public class MyDocType : WebControl
{
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
//base.Render(writer);
if (Page.Request.Browser.Type.Contains("Firefox"))
{
writer.Write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
}
else
{
writer.Write("<!DOCTYPE html>");
}
}
}
}
1. Compile your class into a custom class library project to keep it separate from mojoPortal and avoid forking the code and put the resulting dll in the /bin folder
2. Add this near the top of layout.master
<%@ Register Namespace="MyNamespace.Controls" Assembly="MyNamespace.Controls" TagPrefix="my" %>
assmebly must match the name of the dll without the .dll extension
3. then add your control in layout.master
<my:MyDocType id="dt1" runat="server />