Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You see what you call "screen locks" because of the ASP <code>UpdatePanel</code>s.</p> <p>ASP.NET WebForms are an attempt to make the web act like Windows forms. Admirable? Depends on who you ask.</p> <p>When you use an <code>UpdatePanel</code>, ASP.NET stores the server-side controls in <code>ViewState</code>, makes any changes to that ViewState that is necessary (in your case, it's updating the page based on code in your <code>Timer_Tick</code> and <code>ButtonUpdate_Click</code> functions). Then, it refreshes the page with this new data, causing the screen locks you describe.</p> <p>To get around this, you'll have to use real AJAX. A lot of people do this with jQuery AJAX functions and one of the following options:</p> <ul> <li>ASP.NET WebMethods</li> <li>WCF services</li> <li>Separate ASP.NET pages</li> </ul> <p>There are quite a few questions here on SO about hooking ASP.NET WebMethods up via jQuery, and some about loading ASP.NET pages, but not as many questions about AJAX and WCF.</p> <p>If you choose to use AJAX and jQuery, your resulting page would look something like this:</p> <pre><code>&lt;%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ASForm.aspx.cs" Inherits="Web_Asp_FBMonitor.ASForm" Async="true" EnableSessionState="True" %&gt; &lt;asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server"&gt; &lt;!-- include jQuery library here --&gt; &lt;script language="javascript" type="text/javascript"&gt; $(document).ready(function () { UpdateGrid(); // Separate AJAX call to another page, WCF service, or ASP.NET WebMethod for the Timer results }); function UpdateGrid() { $.ajax({ url: "GridViewResults.aspx", done: function (result) { $("#gridResults").html(result.d); } }); } &lt;/script&gt; &lt;/asp:Content&gt; &lt;asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"&gt; &lt;h2&gt; ASP.NET Connection Test (Client in ASYNC, Server in ASYNC) &lt;/h2&gt; &lt;p&gt; &lt;h3&gt; &lt;span id="timer"&gt;&lt;/span&gt; &lt;/h3&gt; &lt;/p&gt; &lt;p id="gridResults"&gt; &lt;/p&gt; &lt;button id="ButtonUpdate" onclick="UpdateGrid();"&gt;Update&lt;/button&gt; &lt;/asp:Content&gt; </code></pre> <p>Then, on a separate page (I arbitrarily called it <code>GridViewResults.aspx</code> above), you'd have:</p> <pre><code>&lt;asp:GridView ID="GridView1" runat="server"&gt;&lt;/asp:GridView&gt; &lt;asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Default.aspx"&gt;Client Sync Page&lt;/asp:HyperLink&gt; &lt;br /&gt; </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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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