2
のScriptManagerが私のhtmlでAXDのスクリプト参照の多くを出力している私のasp.net:ASPに登録されているスクリプト参照のリストを取得します:のScriptManager
<script src="/ScriptResource.axd?d=B073McDWctL8Kxw1sTGlGNcf...
<script src="/ScriptResource.axd?d=2WiTJxV_YZ2N4lJaAfSKnBVu...
<script src="/ScriptResource.axd?d=jSiywqe6yJ5PAsxeca407Xxb...
...about 4 more ...
今私は、これらの暗号化されたクエリ文字列は、スクリプトの参照を表すことを認識し、例えばアセンブリと名前。私は、登録されたスクリプトのリストを取得したいので、私はそうのように私の複合スクリプトに追加することができます。
<asp:ScriptManager runat="server">
<CompositeScript>
<Scripts>
<asp:ScriptReference Name="Something.js" Assembly="System.Something" />
</Scripts>
</CompositeScript>
</asp:ScriptManager>
私が登録したスクリプトのリストで取得するには、次のコードを試してみたが、それは常にゼロを返します。何らかの理由でスクリプトを実行すると、何が間違っていますか?
protected override void Render(HtmlTextWriter output)
{
var sm = ScriptManager.GetCurrent(this);
foreach (ScriptReference s in sm.Scripts)
{
string debug = s.Assembly + ">" + s.Name + ";" + s.Path;
}
base.Render(output);
}
私はこれまでこれを見つけました... http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=13356 – Chris