RitwikSaha says:
<script type="text/javascript">
$(function () {
var paneName = $("[id*=PaneName]").val() != "" ? $("[id*=PaneName]").val() : "collapseOne";
$("#accordion .in").removeClass("in");
$("#" + paneName).collapse("show");
$(".panel-heading a").click(function () {
$("[id*=PaneName]").val($(this).attr("href").replace("#", ""));
});
});
</script>
Change the above with the below.
<script type="text/javascript">
$(function () {
SetTabs();
});
var prm = Sys.WebForms.PageRequestManager.getInstance();
if (prm != null) {
prm.add_endRequest(function (sender, e) {
if (sender._postBackSettings.panelsToUpdate != null) {
SetTabs();
}
});
};
function SetTabs() {
var paneName = $("[id*=PaneName]").val() != "" ? $("[id*=PaneName]").val() : "collapseOne";
//Remove the previous selected Pane.
$("#accordion .in").removeClass("in");
//Set the selected Pane.
$("#" + paneName).collapse("show");
//When Pane is clicked, save the ID to the Hidden Field.
$(".panel-heading a").click(function () {
$("[id*=PaneName]").val($(this).attr("href").replace("#", ""));
});
}
</script>