Finding the time taken for a asp.net page to render - asp.net

I am having an asp.net page which i was showing as a pop up using Nyromodel.
the page contains
4 div which is showing as Tabs (using Jquery Tabs).
4 Repeater .
Each repeater I am having a custom control and I am setting the
value from db by setting the datasource to repeater. (This query
may have 300-500 rows).
1 infragistics UltraWebGrid. I add
selected values to the grid.
So the problem is it is taking too much time to render if I perform any operation in that UI.
I logged the sp execution time, then I found that SP i taking only 2-3 seconds. But the control will render completely after 30-40 seconds.
So sp execution time alone is not enough to satisfy the my lead. So kindly help me how to analysis the time of rendering the control. Thanks for any Input

I would highly recommend you profile your web page using something like jetbrains's dotTrace or RedGate's profiler. They cost some $$ but highly worth it. You can probably download a trial in the mean time. I believe Visual Studio has some profiling built into it, but I've never been able to use as effectively as dotTrace.

Related

updating data in a grid or something like that when someone inputs new data !(WITHOUT ANY POSTBACKS)

imagine that i have a web page in my application for inputing data and there is a grid at the bottom of them (showing inputing data)...
i want to force this web page acts like a windows application (mean i do not want any postback after enter and that grid should be updated after inputing data without postback)...
imagine that i opened this page in my pc and my friend has opened this page too / i want when i input data in ajax mode , that grid updated for my friend without any postback / like windows application ...
is timer a good idea for doing this ?
or is there a better way for doing that?
thanks in advance
best regards
You're definitely going to have to go AJAX for this - the simplest (but definitely not the most efficient) method would be to add the AJAX Control Toolkit to your project, wrap your GridView in an UpdatePanel, and have a timer on the page to check the database to see if there's anything newer than last time you checked. If there has been a change, you can either re-databind the grid or just render that new content manually (and update the UpdatePanel).

Application performance problem Asp.net

i am facing a big speed problem with my application..we have to go for production but it got push backed becoz of this speed issue..
In my application..i have a page which is the main and important page of whole application..
in this page user spend most of the time...
in this page i am using 6 to 7 javascript files and jquery plugins..
whole page is ajax based and will do the jquery validations...
in this page i have 3 update panels (nested)..one update panel contains one formview and
other will contain one grid and a 4 formviews(will make visible of user selection..4 of the won't come at time..depends on grid view item i will get visible..like grid view record is type one then type one formview will visible on the page)..one update panel is parent update panel..
each formview contains more than 10 controls..dropdowns will load on formview onload event from database loopup tables..
this page won't refresh at all..because ever thing is in update panels..
i can't set the view state to false because of update panels..
i have to make more than 5 database calls each time..
this page works fine at the beginning of application start..after some amount of time its getting slower and slower..the database calls are pretty fast at the beginning and getting very slow after some time...
i don't know how to debug this thing and how to find which one causes this problem....please help me...
Update:
my view state is growing from 35 kb to 160 kb..
and i tried fullpost back triggers for some controls in updatepanels.. but the view state not getting down..its stays like that..on a double or triple browser refresh it got back to 35 kb..is this the issue?? thanks for your replies and suggestions...
I can't really help you if you don't show your code (specifically, the code the runs the database queries that start to slow down), but I can make one (hopefully good) guess:
It sounds like you might not be disposing your database connections properly. Every time you open a connection to the database, make sure you either wrap it in a try/finally block (where .Close() is called in the finally block) or create it with a using block.
You should look into a tool like JetBrains dotTrace that allows your monitor performance on a granular level. Then you will be able to see what the actual cause of your poor performance is. You get a 10 day trial at the website I linked to.
after a very long testing i found the problem...its because of update panels...we should not use update panel for too many controls..I didn't know that and the only control we have in asp.net is update panel for ajax..that's why i used the updatepanels...please stop using updatepanels and try to use jquery..i suffered a lot with this issue...thanks for your support guys...

How do i handle a heavy page?

I have been asked to design & develop a page in asp.net which contains 7 tabs.Each table contains 2 Editable gridview & clicking on gridview cell should open a popup & that popup will open a new popup ( I would say nested popup). even when i switch from one tab to another. It should hold the griddata & whenever user will finish all the operations he/she will click on save button which will save all the data contained in the tabs.
The page is really too too too heavy. It will definitely take a long time to load as it contains gridview operations , popup related jobs, tab data & tab switching.
I am finding the best way i can achieve this with an acceptable speed of operation. Any suggestions or help would be greatly appreciated.
With all of the web-based controls (tabs, grids, anything that uses an intensive postback model) included in ASP.NET, plus those made by 3rd party vendors (Telerik, Infragistics, and the like), it is possible to make very big web pages. And I've made more than a few in my days. Tabs. Multiple update panels. Drop-downs created from dozens of sources. I have decided to remember one simple fact:
WEB_APPLICATION != CLIENT_SERVER
Just because you can, doesn't mean you should. If changing the UI is not an option, keep in mind the following
Look into paging your grid views. Limiting the amount of data rendered on the page will speed up the page.
You can look at caching operations. If you have access to modern browsers, you can make use of isolated local storage on the client. This will be even faster than caching on the server, but you're limited to the really new stuff.
Become a big friend of partial page loads and AJAX operations. You can still build a bigger UI, but keep the actual data operations small and focused. Data-driven drop downs on a hidden tab can be loaded after the visible components of the page have loaded.
I've made a lot of customers very happy because I keep my UI's incredibly fast, and they never break. I keep them fast by keeping them focused. A page is built for a single task. Design for simplicity into UI. You will not be sorry.
Paging.
Caching.
Lazy Loading (through Ajax).
I am not a ASP.net programmer but I think you need to go back to the basics. I am assuming that gridviews are tables.
You could look into the following basic optimizations:
each of your 7 tabs could be a separate http request, that would cut down your load times by 7 for starters
Possible use a combination of cookies and session objects to hold on to the data in the other 6 tabs.
Also, as #LordCover suggested:
Look into ASP.net caching options if any
Use Ajax where you can (editable table cells)
Also, think in terms of the HTML being generated from the ASP page rather than have a completely ASP centric mindset around this.
Also do not rule out a UI redesign, there are many ways to do the same thing. You may be able to break up the UI into simpler pages

ASP.NET amount of data transfered with a repeater really high

I was busy implementing a repeater in an ASP.NET 4.0 to display data that I got from the database, I didn't start with building in paging so at the start allot of data was transfered. I filled a datatable and bound it as the datasource of my repeater.
I noticed the following, while the page was busy loading 4000 records(way to much ofc) 26mb was transfered. This is allot, so I got curious and implementer displaying the same data/html with a for each loop (ofc this is not a good solution load time wise). When the page was loading 10.5 mb was transfered this time.
How come that when using a repeater 26 mb (24 with viewstate disabled) is transfered, and when creating the HTML with a loop 10 mb? Is there anyway to optimize the repeater? I implemented just the basic(creating itemtemplate, filling datatable from database and binding it to the repeater)
The repeater will only output the code that you tell it to. So I would do what #Aristos said in their comment and compare the markup returned. If you could post the markup for the first record in both cases, that would be helpful for us to answer your question.
One other thing you might look at that I have come accross a couple of times. In Firefox in particular, if you have an empty javascript link like the one below, the entire markup of the page is retrieved rather than just nothing. Now this might just be a bug in the Firebug Add-On, but it might explain the doubling of the download size. Although I am not sure why this would be caused by using a repeater without seeing some code. It is worth bearing in mind.
<script type="text/javascript" src="" ></script>
I've run into similar problems. My first line of defense was removing all the white space from within the repeater's template. This reduced the volume of data by about half (3.7 MB to 1.6MB) on a repeater that had 1600 repetitions. Since it's so easy to do ( in visual studio edit->advanced->remove horizontal whitespace) it's worth doing first thing.

Alternative UI control for large data lists instead of DropDownList

I am using C# and ASP.NET with version 2.0 of the .NET Framework library on this particular project. We are also using the AjaxControlToolkit. The AjaxControlToolkit should have the controls available to make a descent User Interface solution to the problem I'm facing.
I have run into this in a few projects in the last year, and used different solutions in the past. The current design of the project I just picked up, is that there is an <asp:DropDownList> control and on page load a Database call is made to get a list of values. This is then bound using DropDownList's datasource. The problem is that there is 25k items returned from the database. First thing, that's not acceptable for a user to have to scroll through tens of thousands of items. But, even more importantly, is that in every browser that it is tested on (IE 7, FF 3, Safari, and Chrome) the browser completely hangs as it is propagating the dropdownlist items.
What I'm thinking is using a Modal Popup form, which an Autocomplete Extender that allows the user to drill down to a specific company. So, in the field where they have to choose a company, they click on a "select company" icon, the modal form comes up, letting them use the autocomplete extender to select an existing company. They click "Ok" and it save the value to the field.
However, I'm an old school command line/shell/terminal guy, and my ideas of acceptable UI design might be skewed (give me a command prompt on any system, and I'm good to go). I would like the advice of those in the community here as to what they think would be an acceptable solution, or if they have faced other issues like this.
I think your idea for the autocomplete extender is the best solution. I've had this problem as well (sounds similar--a project you are taking over from somebody else). The push-back often comes from the user side. They are used to being able to select from a list of items. Unfortunately as the database grows, this becomes less and less feasible.
But when you have 0.5MB of html downloaded on the page (not including the viewstate), compromises have to be made.
Why do you think you need to create modal popup? Can't you just have the extender on your data entry page?
I had to deal with the same issue. But I ended up using a combobox with paging support and auto complete. Currently this combobox happens to be from Telerik. Its a comboBox for auto complete since you can't type into a droplist.
I agree that no user is going to want to look thru 25,000 items to find the one they want. Is there some way you can limit the data so that they drill down? Like selecting a region or type of company first and then showing the ones that match?
Multiple cascading ListBoxes, each futher refining the resultset of the previous
AJAX AutoCompleteExtender

Resources