Link to home
Start Free TrialLog in
Avatar of Angel02
Angel02

asked on

Webpage is working unusually slow

I am working on a webpage in my web application. It is a fairly simple application with a datagrid which is populated from an Excel file and also from the database. The number of rows in the datagrid is in hundreds. I understand if it takes time to upload the rows. But after the datagrid is loaded, even a button click event is taking like 2 minutes. The button click event is just making a panel message box visible. How can I figure out what's taking so long?
SOLUTION
Avatar of Miguel Oz
Miguel Oz
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
in the datagrid, turnoff viewstate and c if the page is any faster.
Also make sure that u are binding the grid in "If not Page.IsPostBack" in page load
Show us some code.
Avatar of Angel02
Angel02

ASKER

I have attached code for my function BindGrid() which loads the Datagrid. I use a stored procedure to populate the datagrid.
I also have a ItemDataBound Event where I am assigning different colors to the rows depending on a column value. I have used similar code for ItemDataBound event in other webpages but they were not not slowed down.

- After the datagrid is loaded, any onclick event is taking for ever to complete. It looks like the whole page is refreshing, although the onclick event which just makes an asp:Panel visible is not supposed to refresh the page.
It is taking time to reload the page even if a button click just calls
Response.Write("<Script Language='JavaScript'>alert('Are you sure you want to continue?');</Script>")

- I made enableviewstate="false". The on click events worked super fast as expected. But after a button or checkbox click, the datagrid disappeared.

- I am not binding the datagrid in the pageload(). I have a "browse" button on my webpage which selects an Excel file and when I click "Upload", then the datagrid is loaded.
BindGrid.txt
ItemDataBound.txt
are you calling BindGrid() function for some other process in same page?

check the BindGrid occurrences.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Angel02

ASKER

I traced for bindgrid occurrences. It is being called only once. The page is being loaded after every click but bindgrid() is not in page load.
I'll try the code to use the session and see.