0

Page_Load着信Querystringに必要な属性が含まれていない場合、または形式が正しくない場合に、メッセージとイベントからユーザーをリダイレクトするボタンを含むモーダルエラーボックスを開きたいのですが。

ダイアログを開くための関数を定義しましたが、またはjQueryを介して登録しようとすると、表示されません。RegisterStartupScriptRegisterClientScriptBlock

function showErrorPopup() {
    $('#errorDialog').dialog({
        autoOpen: false,
        height: 120,
        width: 500,
        draggable: false,
        resizable: false,
        modal: true,
        title: "Error!",
        open: function (type, data) {
            $(this).parent().appendTo("form");
        },
        close: function (type, data) {
            $('#addNoteButton').hide();
        }
    });
    $('#errorDialog').dialog("open");
    $('#addNoteButton').hide();
}

そしてPage_Load

string cID = Page.Request["c"];
int contractID = 0;
if (cID != null)
{
    try
    {
        contractID = Convert.ToInt32(cID);
        Contract contract = FacadeFactory.ProjectsFacade.GetContract(contractID);
        TFSContract source = TFS.GetTFSContract(contract);
        Contract = source;
    }
    catch (Exception)
    {
        errMessage.Text = "Zakázka s tímto číslem neexistuje!";
        ScriptManager.RegisterClientScriptBlock(this, typeof(Page), UniqueID, script, true);
        return;
    }

}
else
{
    errMessage.Text = "Zakázka s tímto číslem neexistuje!";
    ScriptManager.RegisterClientScriptBlock(this.Page, typeof(Page), this.UniqueID, script, true);
    return;
}

誰かがこれをどのように達成できるか教えてもらえますか?

4

0 に答える 0