I have an ASP.Net app that I have written in C#. I have one page that has "tabs" and each one will hide/show a specific span. When the main page loads, it loads all of the pages. I have a bunch of DropDownLists on these pages. So I created a function that fills these lists in with a HashTable. Here is that function...
Anyway, I have a "tab" that has over 15 DDL's, and it takes over two minutes to load. This isn't really acceptable. I set up some trace messages throughout my code to see where the holdup was. The function itself takes less than a second to run. However, it takes between 3 and 7 seconds to get into each call of the function. Why is it taking so long from the end of one function call, to the beginning of the next function call? Neither of the parameters change, is there a way to make them read-only to make this run better? Thanks in advance for any help!
Code:
public void fillDDList(Hashtable inpHash, DropDownList inpDDL)
{
inpDDL.DataSource = inpHash;
inpDDL.DataValueField = "Key";
inpDDL.DataTextField = "Value";
inpDDL.DataBind();
inpDDL.Items.Insert( 0, new ListItem("", "-1") );
inpDDL.SelectedIndex = inpDDL.Items.IndexOf( inpDDL.Items.FindByText(" ") );
}
Anyway, I have a "tab" that has over 15 DDL's, and it takes over two minutes to load. This isn't really acceptable. I set up some trace messages throughout my code to see where the holdup was. The function itself takes less than a second to run. However, it takes between 3 and 7 seconds to get into each call of the function. Why is it taking so long from the end of one function call, to the beginning of the next function call? Neither of the parameters change, is there a way to make them read-only to make this run better? Thanks in advance for any help!