SimpleModal breaks ASP.Net Postbacks

前端 未结 10 1953
名媛妹妹
名媛妹妹 2020-12-08 20:00

I\'m using jQuery and SimpleModal in an ASP.Net project to make some nice dialogs for a web app. Unfortunately, any buttons in a modal dialog can no longer execute their po

10条回答
  •  情话喂你
    2020-12-08 20:30

    got caught out by this one - many thanks to tghw and all the other contributors on the appendto form instead of body fix. (resolved by attributes on the 1.3 version)

    btw: If anyone needs to close the dialog programmatically from .net - you can use this type of syntax

    private void CloseDialog()
    {
        string script = string.Format(@"closeDialog()");
        ScriptManager.RegisterClientScriptBlock(this, typeof(Page), UniqueID, script, true);
    }
    

    where the javascript of closedialog is like this....

        function closeDialog() {
            $.modal.close();
        }
    

提交回复
热议问题