it ends up in a produced .dll in a published bin folder one way or another
.aspx and .ascx files produce control object trees with all strings between %>aaa<% being converted to Literal("aaa") and inserted to a control tree at correct places.
These classes that are descendant from Page (or base Page class of your choice) and WebUserControl are always compiled but without precompilation they reside in temporary asp.net folders; with pre-compilation they are placed inside your precompiled package right away.
For example the following .ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %>
<div class="customhtml">
<asp:Label ID="Label1" runat="server" Text="<%#Page.Title %>"></asp:Label>
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>
results in the following (option no merge):
webusercontrol.ascx.#hash#.compiled
<?xml version="1.0" encoding="utf-8"?>
<preserve resultType="3" virtualPath="/WebSite1/WebUserControl.ascx" hash="fffffff7f6e43006" filehash="8f74adc78f7714d1" flags="110000" assembly="App_Web_aslslubn" type="ASP.webusercontrol_ascx">
<filedeps>
<filedep name="/WebSite1/WebUserControl.ascx" />
<filedep name="/WebSite1/WebUserControl.ascx.cs" />
</filedeps>
</preserve>
that allows you to find what assembly it is compiled to - App_Web_#hash# and type - ASP.webusercontrol_ascx
Disassembling it shows the following class declaration:
using System;
using System.Diagnostics;
using System.Globalization;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace ASP
{
public class webusercontrol_ascx : WebUserControl
{
private static bool __initialized;
[DebuggerNonUserCode]
public webusercontrol_ascx()
{
this.AppRelativeVirtualPath = "~/WebUserControl.ascx";
if (webusercontrol_ascx.__initialized)
return;
webusercontrol_ascx.__initialized = true;
}
[DebuggerNonUserCode]
private Label __BuildControlLabel1()
{
Label label = new Label();
this.Label1 = label;
label.ApplyStyleSheetSkin(this.Page);
label.ID = "Label1";
label.DataBinding += new EventHandler(this.__DataBindingLabel1);
return label;
}
public void __DataBindingLabel1(object sender, EventArgs e)
{
Label label = (Label) sender;
Control bindingContainer = label.BindingContainer;
label.Text = Convert.ToString(this.Page.Title, (IFormatProvider) CultureInfo.CurrentCulture);
}
[DebuggerNonUserCode]
private Button __BuildControlButton1()
{
Button button = new Button();
this.Button1 = button;
button.ApplyStyleSheetSkin(this.Page);
button.ID = "Button1";
button.Text = "Button";
return button;
}
[DebuggerNonUserCode]
private void __BuildControlTree(webusercontrol_ascx __ctrl)
{
IParserAccessor parserAccessor = (IParserAccessor) __ctrl;
parserAccessor.AddParsedSubObject((object) new LiteralControl("\r\n<div class=\"customhtml\">\r\n "));
Label label = this.__BuildControlLabel1();
parserAccessor.AddParsedSubObject((object) label);
parserAccessor.AddParsedSubObject((object) new LiteralControl("\r\n "));
Button button = this.__BuildControlButton1();
parserAccessor.AddParsedSubObject((object) button);
parserAccessor.AddParsedSubObject((object) new LiteralControl("\r\n</div>\r\n"));
}
[DebuggerNonUserCode]
protected override void FrameworkInitialize()
{
base.FrameworkInitialize();
this.__BuildControlTree(this);
}
}
}
In particular you can find your HTML code as LiteralControl being addedd
[DebuggerNonUserCode]
private void __BuildControlTree(webusercontrol_ascx __ctrl)
{
IParserAccessor parserAccessor = (IParserAccessor) __ctrl;
parserAccessor.AddParsedSubObject((object) new LiteralControl("\r\n<div class=\"customhtml\">\r\n "));
Label label = this.__BuildControlLabel1();
parserAccessor.AddParsedSubObject((object) label);
parserAccessor.AddParsedSubObject((object) new LiteralControl("\r\n "));
Button button = this.__BuildControlButton1();
parserAccessor.AddParsedSubObject((object) button);
parserAccessor.AddParsedSubObject((object) new LiteralControl("\r\n</div>\r\n"));
}