The button didn't get fired while clicked on the modal-box

﹥>﹥吖頭↗ 提交于 2019-12-04 08:41:50

not tested but should work.

i think you can also avoid to use inline js and just bind the click event of the buttonLink

#dialog-form { display:none } /* CSS */

<script>  /* JS */
/* Assuming all dialogs share the same default Settings in this grid scenario */
var grid_modal_options = {
        height: 300,
        width: 350,
        modal: true
};
function shopModalPopup(id){
    var DataField = id;
    grid_modal_options.open = function(){
        $('#dialog-form #Textbox1').val( DataField );
        // OR
        // $('#dialog-form').find('textarea').val( DataField );
    };

    $("#dialog-form").dialog(grid_modal_options);
} 
</script>

You can bind javascript event like this...

<asp:LinkButton ID="LinkButton" runat="server" OnClientClick="SomeMethod();" />

other way you can bind javascript method in code behind where you have more control an example is here

If you are passing arguments into your javascript function, for instance you are passing to arguments in javascript then you should define you function like

function SomeFunction(arg1, arg2)
{

//your statements

}

If you're post back is not firing it is likely that your modal is not within your form with runat=server. I've run into this before when using the jQuery UI Dialog. You'll need to move the modal back inside the <form></form> tags.

Try this after you've initialized your modal:

$("#dialog-form").parent().appendTo('form:first');

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!