Note that there are some explanatory texts on larger screens.

plurals
  1. POAjax.net - Improve Page Load Time
    primarykey
    data
    text
    <p>here's my problem. I'm developing a website that will allow users to book hotels all around the world, just like booking.com, expedia.com, etc. </p> <p>When the user searches for hotels in a certain city, I connect through Web Services with different providers, and then show the results. In almost every provider this means:</p> <p>1) Calling a method in WS that returns available hotels in the city for selected dates. For each of these hotels:</p> <ul> <li>2) Read from a very large XML files (usually more than 1) to obtain static information like address, phone, fax, description, services, etc. </li> <li>3) Call a second method in WS to get available rooms information.</li> <li>4) Show result</li> </ul> <p>The problem I'm having has to do with page load time, which is a key factor in these Websites. </p> <p>The first call to the WS (point 1), it's something necessary in which there's not much I can do, so I have to accept this time. The other two points are also necessary, but my intention is to improve the user experience by <strong>showing hotels as they load</strong>. </p> <p>Let's say you are looking for hotels in Buenos Aires. You enter "Buenos Aires" as your destination, and hit the "Buscar" button. As you may notice, a loading message is shown until the following page has been completely loaded. Instead of waiting for all hotels to load, what I would like to do, which I think will improve user's experience is:</p> <ol> <li>When user hits "Buscar" button, immeadiately send user to HotelList page</li> <li>Show each hotel as their information is obtained, and a message on the top saying something like "Loading 1 of XXX hotels"... "Loading 2 of XXX hotels" ...</li> </ol> <p>I've been looking for ajax examples that would describe how to achieve this, but haven't found any clear articles. I would really much appretiate is someone could point me out in the right direction. </p> <p>Thanks!</p> <h2>---------------------------------------------------------------------------</h2> <p>Tried using multi-threading but results aren't displayed. I'm showing the results using a Literal Control. Here's a piece of the code:</p> <p>HotelList.aspx</p> <pre><code>&lt;asp:Literal ID="HotelesResultadoBusqueda" runat="server"&gt;&lt;/asp:Literal&gt; </code></pre> <p>HotelList.aspx.cs</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { ... ... ThreadStart job = new ThreadStart(CargarHoteles); Thread thread = new Thread(job); thread.Start(); } private void CargarHoteles() { // Load Hotels ArrayList hotels = WebService...... foreach(Hotel hotel in hotels) {.....} .... this.HotelesResultadoBusqueda.Text = "..."; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload