First of all please create a website in Visual Studio. On the default page create the "div" architecture.
The CSS classes and the onclick functions mentioned in div definitions are elaborated in more detail later in this article.
CSS: Add a CSS file to the created solution:
JavaScript: all major functionality is handled by JavaScript. Please add a Jscript (.Js) file to the solution. Functions and variables are elaborated below:
In the above two lines, two variables are defined for matching Ids of divx in the created architecture.
The CheckState() function checks whether state cookie exists or not and accordingly make calls to proper functions.
The above two functions handle saving the current expand/collapse state of "div" elements and retrieval of saved state respectively.
This function is for toggling expand/collapse image.