jQuery Dialog-Postback but UpdatePanel doesn't get updated

前端 未结 4 1471
情歌与酒
情歌与酒 2020-12-01 22:00

i want to show a jQuery UI Dialog from Codebehind and need to refresh it after postbacks.

The dialog is a control to filter and find data. So the user selects from

4条回答
  •  忘掉有多难
    2020-12-01 22:26

    Here is how I solved the same issue. It removes any old dialogs and adds the newly updated one back to the form so the postbacks work. I put the following code in a script block that gets added to the page via ScriptManager.RegisterStartupScript in the code behind.

    $('#divMyDialogAdded').remove();
    
    $('#divMyDialog').dialog({
        autoOpen: false,
        modal: true
    }).parent().appendTo('form:first');
    
    $('#divMyDialog').attr('id', 'divMyDialogAdded');
    

提交回复
热议问题