<script type="text/javascript">
$('.Ok').live('click', function () {
$("#popUp").dialog("close");
$('#mydiv').html("");
$.ajax({
url: "/HRBankInfo/_Partial",
type: "Get",
datatype: String,
success: function (stu) {
$('#mydiv').append(stu);
}
});
});
</script>
my html codes
This is my Html form…
This is Code to create UI with Yes no Button for Conformation.
<h3>Are you sure you want to delete this Address?</h3>
<fieldset id="_Create">
<legend>Confirm Delete</legend>
@using (Html.BeginForm())
{
foreach (var item in Model.classes)
{
<div class="display-label">Bank Description:</div>
<span>Bank Name :</span>@Html.DisplayFor(BName => item.BName)
<p><span>Address :</span>@Html.DisplayFor(BAdd=>item.BAdd)</p><br />
}
<input type="submit" value="Yes" />
<button class="close">No</button>
}
</fieldset>
Thus is script for loading value to division
<script type="text/javascript">
$(function () {
$('form').submit(function () {
$.ajax({
url: this.action,
type: this.method,
data: $(this).serialize(),
success: function (result) {
$('.popUp').html(result);
}
});
return false;
});
});
</script>
This is script for pop up dialog
<script type="text/javascript">
$(function () {
$('form').submit(function () {
$(".popUp").dialog({
resizable: false,
modal: true
}
);
});
});
</script>
<div class="popUp" title="Message">
</div>
Thanks for the help
the above code is working for only one popup.how to close multiple popus at a time
thanks for the help.
You are using the id selector
#popUpto identify your popups, however on an HTML page there should only be one element with a given id – I assume that you have given all of your pop-ups the same id.Try changing the id to a class instead, and altering your jQuery selector to
.popUp.