y ouはこれらの2つのWebサイトに異なるアプリケーションプールを設定しようとしましたか?それは "スマート"にしようとしているように見え、2つの仮想ディレクトリは実際には同じWebサイトであると結論づけています。
その他すべてが失敗した場合は、ASP.NETが手動で生成するFORMタグのポストバックURLを書き換えることができます。おそらく、App_BrowsersファイルとControlAdapterを使用するのが最もクリーンな方法です。
このようなControlAdapter実装の例がありますが、ポストバック時に実際の裏目のURLに戻らないようにURLの書き換えを行うことを目的としています。しかし、私はそれがあなたの問題のために、すぐに使える
public class FormRewriterControlAdapter : System.Web.UI.Adapters.ControlAdapter
{
protected override void Render(HtmlTextWriter writer)
{
base.Render(new RewriteFormHtmlTextWriter(writer));
}
}
public class RewriteFormHtmlTextWriter : HtmlTextWriter
{
private const string contextItemKey = "FormActionWritten";
public RewriteFormHtmlTextWriter(HtmlTextWriter writer) : base(writer)
{
InnerWriter = writer.InnerWriter;
}
public RewriteFormHtmlTextWriter(System.IO.TextWriter writer) : base(writer)
{
base.InnerWriter = writer;
}
public override void WriteAttribute(string name, string value, bool fEncode)
{
// If the attribute we are writing is the "action" attribute, and we are not on a sub-control,
// then replace the value to write with the raw URL of the request - which ensures that we'll
// preserve the PathInfo value on postback scenarios
if (name == "action" && !HttpContext.Current.Items.Contains(contextItemKey))
{
// Use the Request.RawUrl property to retrieve the un-rewritten URL
value = HttpContext.Current.Request.RawUrl;
HttpContext.Current.Items[contextItemKey] = true;
}
base.WriteAttribute(name, value, fEncode);
}
}
Form.browserファイルに働くだろうと思う:新しいアプリケーションプールをしようとしました
<browsers>
<browser refID="Default">
<controlAdapters>
<adapter controlType="System.Web.UI.HtmlControls.HtmlForm" adapterType="FormRewriterControlAdapter" />
</controlAdapters>
</browser>
</browsers>
...ないサイコロを...私は、カスタムコントロールを含む100以上のクラスを含む40以上のプロジェクトに取り組んでいます... – Patrick
何も書き直す必要はありません。上記のコードは、問題を解決するために必要なすべてのものでなければなりません。 – Thorarin