1

.load() 関数を使用して .aspx ページを jQuery UI ダイアログにロードしていますが、これは正常に機能します。問題は、読み込まれているページがダイアログを開く呼び出しの元とは異なるディレクトリにあり、新しく読み込まれたページから「送信」ボタンを押しようとすると、「search.aspx」パスが見つからないことです。元のパスを見ているからです。

基本的:

ucEasyFill.ascx には、div 宣言と、モーダル ポップアップを開くためのリンクが含まれています。これは、forms/UserControls/ フォルダーにあります。

<div id="modalSearchWindow" style="display:none;" class="MODAL_SEARCH_WINDOW"></div> 

<img id="imgClearClient" src="images\clear.png" class="efIMG" />Clear </a><a href="#" id="lnkFindClient" name="lnkFindClient" onclick="javascript: MODAL_SEARCH_WINDOW.dialog('open');"><img id="imgSearchMag" src="/applications/images/search_mag.gif" class="efIMG" />Find</a>

ucEasyFill.js には、forms/scripts/ フォルダーの document.ready 関数内にダイアログ宣言が含まれています。

MODAL_SEARCH_WINDOW = $("#modalSearchWindow").load('EasyFill/Search.aspx').dialog({
    position: "center",
    autoOpen: false,
    resizable: false,
    autoResize: true,
    draggable: true,
    modal: true,
    width: 580,
    height: 450,
    dialogClass: "MODAL_SEARCH_WINDOW",
    closeOnEscape: true,
    open: function (event, ui) {
        $('.MODAL_SEARCH_WINDOW .ui-dialog-titlebar').each(function () {
            $(this).css("display", "none");
        });
    }
});

ページで「検索」をクリックするとforms/EasyFill/Search.aspx、次の 404 エラーが表示されます。

    POST http://localhost/applications/forms/Search.aspx 404 (Not Found) 

/forms/ダイアログはディレクトリからではなくディレクトリからロードされているので、これは私には理にかなっていますforms/easyfill/。本当に私の質問は、どうすればこれを回避できますか? showModalDialog()Chrome 37での新しい非推奨のため、私はこれをやろうとしているだけです

4

1 に答える 1