I have a modal that gets dynamically loaded when a user clicks a button on a grid. The modal content is populated from an ascx user control. It has to be inside the update panel as the values change dynamically when the user clicks the grid.
I add the following to display the modal:
The problem is, when i submit the modal since the modal is ajax-y it does a partial postback causing the modal not to close.
I've tried using an onclientclick to close the modal then postback via javascript but the postback does not occur.
This will close the modal, but not fire the postback:
Then of course removing the onclientclick and just handling the onclick triggers the postback, but does not hide the modal.
I add the following to display the modal:
Me
.LoadMyUserControl(
"~/controls/Log.ascx"
, Panel1)
Dim
MessageScript
As
String
=
"$('#modal-interact').modal('toggle');"
ScriptManager.RegisterStartupScript(
Me
,
GetType
(Page),
"UniqueID1"
, MessageScript,
True
)
The problem is, when i submit the modal since the modal is ajax-y it does a partial postback causing the modal not to close.
I've tried using an onclientclick to close the modal then postback via javascript but the postback does not occur.
This will close the modal, but not fire the postback:
<script type=
"text/javascript"
>
function confirmthis()
{
$(
'#modal-interact').modal('hide');
return true;
}
</script>
Then of course removing the onclientclick and just handling the onclick triggers the postback, but does not hide the modal.