You're creating a web request for every single record that you're querying, you're creating and not disposing unmanaged resources, all your data fetching is being done on the server side. It's not surprising that you're seeing hard lag.
Your primary issue is this: your code behind runs on the server and so every time you trigger that accordion you are:
- Sending a request to the server.
- Having the server send 9 synchronous web requests...to itself. But since it's using DNS it has to go out to the world to talk to itself.
- Perform whatever operations are requested for the data and stream it back to itself. At least it should only have to go to the closest managed switch or router to get back to itself this time.
- Run the information that it just web requested from itself into your AccordionPane control.
- Render and send back to the client
If all the panes are the same and you don't want to learn the basic jQuery needed to run a jQueryUI accordion (always more effective to keep presentation on the presentation layer), I suggest that you create the control once, get the associated data once, and copy the control in your loop and populate it with your data.
And dispose your unmanaged resources, if you still need them after refactoring. even if it's as simple as:
WebRequest request = HttpWebRequest.Create("http://sampleOnly.com/accordionTemplate.aspx?id=" + i.ToString() + "");
using(WebResponse resonse = request.GetResponse())
{
using(StreamReader srReader = new StreamReader(resonse.GetResponseStream()))
{
}
}