views:

95

answers:

0

Hi All, I am using ASP.NET Ajax and jQuery. I currently have a formView control that has a submit button on it. It triggers updates on the update panel it is contained within. Currently I have a client side function that returns a confirm(msg), if this is false the form is not submitted, else it submits and the updates are properly triggered. I just started getting my feet wet with JqueryUI and I really like the dialog implementation. I have looked at a few examples of how to make the dialog buttons submit the form. I cannot get this to work. The examples I have seen online do not use an update panel I am guessing. Anyways here is what I have thus far. I need not only to submit the form, but trigger the update panel to update. The way it currently works.

$(document).ready(function() {
     $('#confirm').dialog({
        autoOpen: false
            , width: 550
            , maxHeight: 275
            , maxWidth: 800
            , minWidth: 300
            , modal: true
            , buttons: {

                "Cancel": function() {
                    $(this).dialog("close");

                },
                 "Ok": function() {

                $(this).dialog("close");
                eval($("#<%= hdnBtnPostback.ClientID %>").val()); 
                   // eval(WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$DefaultContent$payment1$paymentfrmView$btnSubmitPayment", "", true, "", "", false, false)));


                }
            }
    });

//I am also appending the dialogs parent to the form tag.
// I saw this online as a fix     but it seems to have no effect.

$("#confirm").parent().appendTo($("form:first"));

I tried using the raw javascript that was attached to the onclick of the submit button and that didn't seem to work, hence the comment. The other approach I used was adding a postbackbackreference string to a hidden control on the page and then eval that to submit the form. Nothing seems to work. Any ideas what I am doing wrong? Here is the postbackReference code.

hdnBtnPostback.Value = ClientScript.GetPostBackEventReference(mySubmitButton, string.Empty);
});

Thanks for advice or tips, ~ck