I have settings page in my wp7 application. I loads for quite long time first time since I add looping selector. I there any correct way to precreate\preload this page earlier;
It's not possible to preload the page but there are lots of other things that could be done to improve the load time/performance:
Adjusting when in the page lifecycle the contents are loaded
What's loaded
The order items are loaded
The complexity of what and how things are displayed
Preload the data/model
and many more...
Related
I have a page which uses WebParts to display differents sections that the users can configurate, so in this page can be lots of them, each of them calling to our API to retrieve DB data.
Right now, these sections are loading synchronously, and the page may need too much time to load, so I've wrapped each section in an UpdatePanel and tried to load them asynchronously. I use an asp:Timer to do so. Now, the page renders and then the UpdatePanels start to load when the timer ticks, but the problem is that these UpdatePanels load synchronously (one after the other). So, if the first UpdatePanel needs 10 seconds to load, the second one will start to load just after.
What can I do to load them all at once asynchronously?
Thanks in advance
asp.net webforms is not designed to work asynchronously, so as far as i know you cannot tweaks the updatepanels to do that.
I suppose you could somehow overload the updatepanel scripts, but it would really add too much complexity.
The easiest thing you could do is to not load all the webparts in the same page.
I have a scraper that scrapes data from three kinds of websites.
One of those websites (Facebook) have multiple page formats that needs to be scraped.
While two websites work fine, one particular Facebook page layout refuses to work or work very strangely. (for other Facebook page layouts I haven't noticed this behavior)
I am reading each link from a file and load into webbrowser control, I wait until each page fully loads (using AutoResetEvent) and then after it loads, I send pages html to other class from the webbrowser_Document_Completed event to do the scraping.
The problem here is that sometimes page is not fully loaded and sometimes it fully loads.
In both cases webcontrol_Document_Completed is fired.
When the page fully loads, it works just fine.
I debugged and indeed, page is not fully loaded and data is missing.
It can pass 4-5 times in a row to fully load the page and then suddenly stops. (random pattern)
I don't know anymore where to look for the culprit.
I thought that my code is not ok so I created new test project that just loads that page and same problem occurs.
So maybe the page is the problem because I also saw that when it doesn't work, needed data is commented.
Maybe some scrape protection...
Page in question is: https://www.facebook.com/pages/Childrens-Dental-Care/76095547112?v=info&viewas=0 and needs to scrape right side of the page where is Joined Facebook, Hours and Parking.
It's //td[#class='data'] element that I need.
If you have any idea that might point to solving this issue...
Thank you!
I have an ASP.NET Webforms master page which is taking 3.5 minutes to render, and I can't figure out why.
I added logging, and it goes through Load and PreRender super fast, but after that, takes 3.5 minutes to get to Unload.
The page being rendered is pretty small, about 80k, and the viewstate is about 10k (guessing).
Figured it out. In my case, Umbraco was responsible for generating the 'Page' as all I had was a MasterPage containing controls. One of these controls had a datasource which was making web requests for each row it got back from the database. These requests were failing silently and timing out.
For a tournament application, i have to output group standings and a knockout schedule. They have to alternate on one big LED TV. I managed to do that using an IFrame that spanned 100% of the page and using javascript to set the iframe source to another aspx page every 10 seconds.
This works but i creates an enormous memory leak. each time a page is loaded in the iframe, the Internet Explorer process grows with about 6mb. this results in a IE process of 1,5Gb and a crash of the window after about 1 hour.
Is there a better way to create something similar? do the cycling all in codebehind?
Thanx,
Cypress
Why the need for the iframe? You could just have the page reload every 10secs with an onload script.
A more clever approach, might be to use AJAX to download only the data you need to display & update the page with that. You could then take a stage further & use something like SignalR to only update the screen when the data changes.
Hii..
I am using a Multiview for a application. Each aspx page contains Multiview.
A single multiview contains atleast 5 to 6 views. (so less no. of aspx pages). When user clicks any button such as say "Edit View" (where user can edit his entries), a diffrent view is displayed. So user feels that he is redirected to another page. So a single aspx page has lot of controls, lot of code - a lil bit heavy page.
Will it affect loading time? is it better to use different aspx pages?
It is better to use different pages for different views. The number of aspx pages doesn't affect the performance, but managing each view on its own page is easier for maintenance.
You may use Multiview for some sort of wizard, but it is better to not use it to just reduce the number of aspx pages in the app.
Alex is right. Even if your views aren't displayed the controls contained in those views are persisted in the __VIEWSTATE. if you take a look at the source of your pages in your browser theres proably going to be a few Kb's of VIEWSTATE.
A colleague once built a page that had 380Kb of VIEWSTATE. That will affect performance!
Multiviews can work great in minimalist settings, but don't do like I did early on and attempt to build the equivalent to a 15 page medical form all in one ASPX page using the MultiView. If you are building short and sweet panes your performance will not suffer as much, but you will eventually cross the threshold and your performance will go into the gutter.