Application performance problem Asp.net - 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...

Related

Update panel send all the page to the server

Good morning everyone, I have a page with a section on the left (an ascx control) with an updatepanel and on the right the remaining part of the page.
The update panel here works pretty well and I am happy for its job.
However in another page I have the same ascx control on the left and tens of pictures on the right.When I use here the dropdown on the left menu (contained in the updatepanel), before to receive serverside the command takes a lot of time and by my opinion is due the browser is uploading all the info (pictures,.. in general the whole page ) again to the server.
Is it possible this my assumption, I haven't found advice on internet and I have a big problem of performance.
Just to highlight one thing the update panel is working , I am correctly updating only the update panel without a full postback, the problem is during the server call that takes time ....
Kind Regards,
luca

Update Panel posts back after a period of inactivity

I have a asp.net user control in a SharePoint solution. This user control uses Telerik Asp.net Ajax controls to provide a basic datagrid CRUD operations. I use this grid in a web part on a page in SharePoint 2013.
I have a datagrid which is wrapped with RadAjaxPanel to ajaxify it.
It all works fine. However, let's say, I click the add new record button and it opens a form to fill, if I leave that form intact for a minute, then start to fill and submit, it does postback and cancels form.
However, if I click on add new record and fill the form and submit, it all works fine. I guess there is a timeout somewhere which causes this, my two days of research did not help me to find it.
I was just wondering whether you have ever come across with this issue. I guess it does not matter whether it is Asp.net update panel or RadAjaxUpdatePanel, even if you have seen this issue on Asp.net update panel, that will help too.
I did not know what part of the code I should share, please let me know if you need any code to understand this issue.
There must be something on SharePoint script manager, and ajax manager, but I have no idea what.
It looks like it is a known bug in SharePoint 2013. People suggested to install December 2014 CU to solve it, but it did not solve it. Someone mentioned in this link to make request to server via javascript event given interval. As my page does postback if I leave it about 20-30 sec idle, I call a random SP web service evet 15 sec which seems to resolve my issue. Please see below link which helped me to workaround this.

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

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.

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).

A big dilemma - ASP.NET and jQuery

I have a wizard style interface where I need to collect data from users. I've been asked by my managers that the information is to be collected in a step by step type process.
I've decided to have a page.aspx with each step of the process as a separate user control. step1.ascx step2.ascx etc...
The way it works now, is that when the initial GET request comes in, I render the entire page (which sits inside of a master page) and step1.ascx. When then next POST request comes in for step 2 (using query string step=2), I render only step2.ascx to the browser by overriding the Render(HtmlTextWriter) method and use jQuery html() method to replace the contents of a div.
The problem with this whole approach, besides being hacky (in my opinion) is that it's impossible to update viewstate as this is usually handled server side.
My workaround is to store the contents of step1.ascx into temporary session storage so if the user decides to click the Back button to go back one step, I can spit out the values that were stored for it previously.
I feel I'm putting on my techy hat on here in wanting to try the latest Javascript craze as jQuery with .NET has taken a lot of hack like approaches and reverse engineering to get right. Would it be easier to simply use an updatepanel and be done with it or is there a site with a comprehensive resource of using jQuery to do everything in ASP.NET?
Thanks for taking the time to read this.
Another approach, that might be easier to work with, is to load the entire form with the initial GET request, and then hide all sections except the first one. You then use jQuery to hide and show different parts of the form, and when the final section is shown the entire form is posted in one POST to the server. That way you can handle the input on the server just as if the data entry was done in one step by the user, and still get the step-by-step expreience on the client side.
You could just place all your user controls one after another and turn on the visibility of the current step's control and turn on other controls when appropriate . No need to mess with overriding Render(). This way the user controls' viewstate will be managed by the server. and you can focus on any step validation logic.
Using an UpdatePanel to contain the steps would give the ajax experience and still be able to provide validation on each step. If you are OK with validating multiple steps at once, Tomas Lycken's suggestion (hide/show with JQuery), would give a fast step by step experience.
Did you look into using the ASP.NET Wizard control? It's a bit of a challenge to customize the UI, but otherwise it's worked well for me in similar scenarios.

Resources