Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with some performance issues

Status
Not open for further replies.

dcusick

Technical User
Aug 9, 2000
271
US
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...

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!
 
are these tabs holding controls realted to other tabs?
if not why dont u use iframes???

Known is handfull, Unknown is worldfull
 
you know, I actually figured out what my issue was. I am working on the GUI interface. A Co-worker is doing the data-object layer. I was calling his data layer to get the hashtable for each dropdownlist. This was eating up time. I changed my app, so I preload all of the hashtables in the Application, then I can just get them disconnected, and I improved my performance from Two and a half minutes, to Five seconds.

Thanks for the suggestion vbkris. I will look into that option to further enhance my code...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top