User475983607 posted
I am using bootstrap collapse class to expand and collapse some panels in a web page.
They don't maintain their states after post back. How can I prevent it?
Correct. The web and HTML controls are stateless. It is up to you to design and write code to maintain state. Write a JavaScript function that updates a hidden field or fields that track which elements are expanded. Add another JavaScript
function that expands those fields when the page loads.
If you run into trouble, share your code. Explain how you expect the code to function and what actually happens. Be sure to debug your code...