何らかの方法で、公開された bin フォルダー内の生成された .dll になります。
.aspx および .ascx ファイルは、%>aaa<% の間のすべての文字列が Literal("aaa") に変換され、コントロール ツリーの正しい場所に挿入されたコントロール オブジェクト ツリーを生成します。
Page (または選択した基本 Page クラス) および WebUserControl の子孫であるこれらのクラスは、常にコンパイルされますが、プリコンパイルされずに、一時的な asp.net フォルダーに存在します。プリコンパイルでは、プリコンパイル済みパッケージ内にすぐに配置されます。
たとえば、次の .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>
結果は次のようになります (マージなしオプション): 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>
コンパイルされたアセンブリを見つけることができます - App_Web_#hash# とタイプ - ASP.webusercontrol_ascx
逆アセンブルすると、次のクラス宣言が表示されます。
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);
}
}
}
特に、追加されている LiteralControl として HTML コードを見つけることができます
[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"));
}