I have a bootstrap accordion where i try to reopen the last opened pane on a postback as in if someone clicks a save button on my page. I found this solution: Retain Twitter
In general, whenever you want to retain a value after postback in ASP.NET there is a common approach.
Store the value in an ASP.NET hidden field. In your case store the value of following active variable in a hiddren field.
var active = $("#applicant-accordion .in").attr('id');
After post back due to the view state maintained by the ASP.NET, the hidden field will retain the value. You can then use this value at the page load to set the accordin.
$(document).ready(function () {
var last = // Get value from the hidden field
if (last != null) {
// Set the accordin values.
}
});