<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tag 'Async'</title><link>http://forums.asp.net/search/SearchResults.aspx?q=&amp;tag=Async&amp;orTags=0&amp;o=DateDescending</link><description>Search results matching tag 'Async'</description><dc:language>en-US</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Updating web page to other user when a user registers in website</title><link>http://forums.asp.net/thread/3561689.aspx</link><pubDate>Sat, 12 Dec 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3561689</guid><dc:creator>jawaharcsc</dc:creator><description>&lt;p&gt;Hi All,&lt;/p&gt;
&lt;p&gt;I need help in udpating the webpage&amp;nbsp;or a custom control placed in the asp.net page when some other user&amp;nbsp;register in&amp;nbsp;my webiste.&lt;/p&gt;
&lt;p&gt;Scenario : For example, 10 users may be viewing &lt;a href="http://www.abc.com"&gt;www.abc.com&lt;/a&gt;&amp;nbsp;&amp;nbsp;and a new user hit &lt;a href="http://www.abc.com"&gt;www.abc.com&lt;/a&gt; and registered in my website, at this time i have to update my webpage for the 10 users who are viewing &lt;a href="http://www.abc.com"&gt;www.abc.com&lt;/a&gt;&amp;nbsp;to say that x user has been registered now in our website.&lt;/p&gt;
&lt;p&gt;can anyone help me in how to acheive this ?&lt;/p&gt;
&lt;p&gt;I have basic knowledge in asp.net,ajax and wcf. So if anyone comes to know any solution please guide me?&lt;/p&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;</description></item><item><title>async doesn't work with jQuery AJAX while sending GET request to read XML file</title><link>http://forums.asp.net/thread/3513803.aspx</link><pubDate>Sun, 15 Nov 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3513803</guid><dc:creator>hardik.net</dc:creator><description>&lt;p&gt;&lt;span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;"&gt;
&lt;div&gt;Hi, I have large XML (~1 MB) file on server.&lt;/div&gt;
&lt;div&gt;From my asp.net page, I used below jQuery snippet to get that file to browser, and iterate through it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;$.ajax({&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;type: &amp;quot;GET&amp;quot;,&lt;/div&gt;
&lt;div&gt;&lt;span style="white-space:pre;"&gt;	&lt;/span&gt;url: &amp;quot;http://www.abc.com/temp.xml&amp;quot;,&lt;/div&gt;
&lt;div&gt;&lt;span style="white-space:pre;"&gt;	&lt;/span&gt;dataType: &amp;quot;xml&amp;quot;,&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;async: true,&lt;/div&gt;
&lt;div&gt;&lt;span style="white-space:pre;"&gt;	&lt;/span&gt;success: function(xml) {&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="white-space:pre;"&gt;	&lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;});&lt;/div&gt;
&lt;p&gt;Everything works fine. The only issue is - until temp.xml loads, my browser becomes unresponsive (it gets freeze). I tried with all possible options. But it didn&amp;#39;t work.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can anyone please help me me with it?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;~Thanks&lt;/p&gt;
&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Change GridView page on Asynchronous Postback</title><link>http://forums.asp.net/thread/3489471.aspx</link><pubDate>Mon, 02 Nov 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3489471</guid><dc:creator>mattucg</dc:creator><description>&lt;p&gt;I am working with a GridView that is inside of an UpdatePanel. The sorting and paging asynchronous postbacks work properly. Each row has a delete link that causes an asynchronous postback. The record representing that row is deleted, and the GridViewRow has its &amp;#39;Visible&amp;#39; property set to false.&lt;/p&gt;
&lt;p&gt;When the row being deleted is the only row on the current page, I would like to have the GridView return to the previous page, but I am having problems.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;On my masterpage, I have a ScriptManager:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre class="xhtml" name="code"&gt;&amp;lt;asp:ScriptManager ID=&amp;quot;ScriptManager1&amp;quot; runat=&amp;quot;server&amp;quot; EnablePartialRendering=&amp;quot;true&amp;quot;  /&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Here is the UpdatePanel/GridView on my page:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre name="code" class="xhtml"&gt;    &amp;lt;asp:UpdatePanel ID=&amp;quot;ApplicationUsersPanel&amp;quot; runat=&amp;quot;server&amp;quot; UpdateMode=&amp;quot;Conditional&amp;quot; ChildrenAsTriggers=&amp;quot;false&amp;quot; &amp;gt;
        &amp;lt;ContentTemplate&amp;gt;
            &amp;lt;asp:GridView ID=&amp;quot;ApplicationUsersGrid&amp;quot; runat=&amp;quot;server&amp;quot; AutoGenerateColumns=&amp;quot;false&amp;quot;
                 DataSourceID=&amp;quot;ApplicationUsersDataSource&amp;quot; 
                 AllowPaging=&amp;quot;true&amp;quot; PageSize=&amp;quot;7&amp;quot; 
                 AllowSorting=&amp;quot;true&amp;quot;
                 EnableSortingAndPagingCallbacks=&amp;quot;true&amp;quot;
                 OnPageIndexChanged=&amp;quot;RefreshApplicationUsersGrid&amp;quot;
                 OnSorted=&amp;quot;RefreshApplicationUsersGrid&amp;quot;&amp;gt;
                &amp;lt;Columns&amp;gt;
                    &amp;lt;asp:TemplateField HeaderText=&amp;quot;User&amp;quot; SortExpression=&amp;quot;UserName&amp;quot;&amp;gt;
                        &amp;lt;ItemTemplate&amp;gt;
                            &amp;lt;asp:Literal ID=&amp;quot;Literal1&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;&amp;lt;%#((ProviderTests.SecurityObjects.ApplicationUser)Container.DataItem).UserName%&amp;gt;&amp;quot; /&amp;gt;
                        &amp;lt;/ItemTemplate&amp;gt;
                    &amp;lt;/asp:TemplateField&amp;gt;
                    &amp;lt;asp:TemplateField HeaderText=&amp;quot;Email Address&amp;quot; SortExpression=&amp;quot;Email&amp;quot;&amp;gt;
                        &amp;lt;ItemTemplate&amp;gt;
                            &amp;lt;asp:Literal ID=&amp;quot;Literal2&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;&amp;lt;%#((ProviderTests.SecurityObjects.ApplicationUser)Container.DataItem).Email%&amp;gt;&amp;quot; /&amp;gt;
                        &amp;lt;/ItemTemplate&amp;gt;
                    &amp;lt;/asp:TemplateField&amp;gt;
                    &amp;lt;asp:TemplateField HeaderText=&amp;quot;Last Activity&amp;quot; SortExpression=&amp;quot;LastActivityDate&amp;quot;&amp;gt;
                        &amp;lt;ItemTemplate&amp;gt;
                            &amp;lt;asp:Literal ID=&amp;quot;Literal3&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;&amp;lt;%#((ProviderTests.SecurityObjects.ApplicationUser)Container.DataItem).LastActivityDate%&amp;gt;&amp;quot; /&amp;gt;
                        &amp;lt;/ItemTemplate&amp;gt;
                    &amp;lt;/asp:TemplateField&amp;gt;
                    &amp;lt;asp:TemplateField ItemStyle-HorizontalAlign=&amp;quot;Center&amp;quot;&amp;gt;
                        &amp;lt;ItemTemplate&amp;gt;
                            &amp;lt;ucg:UserDeleteControl runat=&amp;quot;server&amp;quot; UserName=&amp;quot;&amp;lt;%#((ProviderTests.SecurityObjects.ApplicationUser)Container.DataItem).UserName%&amp;gt;&amp;quot; /&amp;gt;
                        &amp;lt;/ItemTemplate&amp;gt;
                    &amp;lt;/asp:TemplateField&amp;gt;  
                &amp;lt;/Columns&amp;gt;
            &amp;lt;/asp:GridView&amp;gt;
            &amp;lt;asp:ObjectDataSource ID=&amp;quot;ApplicationUsersDataSource&amp;quot; runat=&amp;quot;server&amp;quot; EnablePaging=&amp;quot;true&amp;quot;
                TypeName=&amp;quot;ProviderTests.Admin.UserManagementAJAX&amp;quot; 
                SelectMethod=&amp;quot;GetApplicationUserList&amp;quot; 
                SelectCountMethod=&amp;quot;SelectCount&amp;quot;
                SortParameterName=&amp;quot;sortField&amp;quot;
                OnSelecting=&amp;quot;SetSelectParameters&amp;quot; /&amp;gt;
        &amp;lt;/ContentTemplate&amp;gt;
    &amp;lt;/asp:UpdatePanel&amp;gt;&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;And the UserDeleteControl only has one LinkButton:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre class="c-sharp" name="code"&gt;&amp;lt;asp:LinkButton ID=&amp;quot;DeleteLink&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Delete&amp;quot; /&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;In the Page_Load of the UserDeleteControl, I check which exact control caused an Asynch postback, and do the processing there:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;pre name="code" class="c-sharp"&gt;        protected void Page_Load(object sender, EventArgs e)
        {
            ScriptManager scriptManager = ScriptManager.GetCurrent(Page);
            
            if (scriptManager.AsyncPostBackSourceElementID == DeleteLink.UniqueID)
            {
                GridViewRow currentRow = NamingContainer as GridViewRow;
                if (currentRow == null) return;

                GridView applicationUsersGrid = currentRow.NamingContainer as GridView;
                if (applicationUsersGrid == null) return;

                ContentPlaceHolder pageSection = applicationUsersGrid.NamingContainer as ContentPlaceHolder;
                if(pageSection == null) return;

                UpdatePanel applicationUsersPanel = pageSection.FindControl(&amp;quot;ApplicationUsersPanel&amp;quot;) as UpdatePanel;
                if (applicationUsersPanel != null)
                {
                    Membership.DeleteUser(UserName, true);             
                    currentRow.Visible = false;
                    applicationUsersPanel.Update();
                }
            }
        }
&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;With this method, the deleted row is hidden, but if it is the last row on a page, The GridView sits on the empty page. Doing a full refresh of the page will remove the empty page from the pager and return to a populated page, but I would like to avoid a full reload.&lt;/p&gt;
&lt;p&gt;Setting applicationUsersGrid.PageIndex does not work&lt;br /&gt;Calling applicationUsersGrid.DataBind does not work&lt;br /&gt;I even tried ClientScript.RegisterStartupScript to call the previous page postback on the pager link, but no luck.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Anyone have any suggestions?&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: updatePanel and lightbox</title><link>http://forums.asp.net/thread/3047139.aspx</link><pubDate>Sun, 29 Mar 2009 04:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3047139</guid><dc:creator>simon__</dc:creator><description>&lt;p&gt;Hi Jin-Yu Yin!&lt;br /&gt;&lt;br /&gt;I have exactly the same problem, after the updatepanel asyncpostback, the relationship between the image and the script is lost...&lt;br /&gt;&lt;br /&gt;I tried to use &lt;strong&gt;RegisterClientScriptInclude&lt;/strong&gt;(...) in many different ways, but it never worked.&lt;br /&gt;&lt;br /&gt;I’have tried so far in the “&lt;strong&gt;Page_Load&lt;/strong&gt;” of my &lt;strong&gt;.vb&lt;/strong&gt; file:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Page.ClientScript.RegisterClientScriptInclude(Me.GetType(), &amp;quot;script_id1&amp;quot;, ResolveClientUrl(“./scripts/slimbox_ex.js”))&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;ScriptManager.RegisterClientScriptInclude(me, me.GetType(), &amp;quot;script_id1&amp;quot;, ResolveClientUrl(&amp;quot;./scripts/slimbox_ex.js”&amp;quot;))&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;ScriptManager.RegisterClientScriptBlock(me, me.GetType(), &amp;quot;script_id1&amp;quot;, ResolveClientUrl(“./scripts/slimbox_ex.js”), False)&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Dim header2 As LiteralControl = New LiteralControl&lt;br /&gt;header2.Text = &amp;quot;&amp;lt;script type=&amp;#39;text/javascript&amp;#39; src=&amp;#39;&amp;quot; &amp;amp; ResolveClientUrl(“./scripts/slimbox_ex.js”) &amp;amp; &amp;quot;&amp;#39; &amp;gt;&amp;lt;/script&amp;gt;&amp;quot;&lt;br /&gt;Me.Page.Header.Controls.Add(header2)&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;I have also tried to initialize manually the lightbox calling: &lt;em&gt;Lightbox.init()&lt;/em&gt; &lt;/p&gt;
&lt;p&gt;NOTHING WORKED...&lt;br /&gt;&lt;br /&gt;In the &lt;strong&gt;&amp;lt;head&amp;gt;&lt;/strong&gt; section of my &lt;strong&gt;.aspx&lt;/strong&gt; file I did not put the &lt;em&gt;&amp;lt;script type=&amp;#39;text/javascript&amp;#39; src” ./scripts/slimbox_ex.js”&amp;gt;&amp;lt;/script&amp;gt;&lt;/em&gt; tag.&lt;br /&gt;&lt;br /&gt;I have waste so much time!&lt;br /&gt;I know that I am one year late, but if someone is reading this please help me! &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Difference between async pages and async callbacks?</title><link>http://forums.asp.net/thread/2932275.aspx</link><pubDate>Tue, 10 Feb 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2932275</guid><dc:creator>betamax</dc:creator><description>&lt;p&gt;Hello, I have been learning asynchronous model in ASP.NET and have two contradicting views of it. &lt;/p&gt;
&lt;p&gt;First, after reading a book by Microsoft Press on the topic and an article on MSDN (Wicked Code), it is ample clear that asynchronous code executes between PreRender and PreRenderComplete and the entire page BLOCKS till the async operation is complete. Therefore, we cannot show progress bar or such scenario.&lt;/p&gt;
&lt;p&gt;However, when browsing through code on sites like CodeProject and some weblogs, the authors have suggested using async pages (RegisterAsynctask and prerendercomplete ways) to provide exactly the functionality; that is, async pages and async methods that are provided by sqlcommand and other objects can be used and they do not block the UI because they run the task in a separate thread.&lt;/p&gt;
&lt;p&gt;So, which one is true? I am obviously guessing a book by MS Press is more authentic. But it is making things really hard to learn.&lt;/p&gt;
&lt;p&gt;for example, here is one excerpt from asp.net site:&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;strong&gt;Note&lt;/strong&gt;: An async page does not render to the browser until the EndEventHandler has completed. No doubt but that some developers will think of async requests as being similar to async callbacks. It&amp;#39;s important to realize that they are not. &amp;quot; Taken from &lt;a href="http://www.asp.net/learn/moving-to-asp.net-2.0/module-02.aspx"&gt;http://www.asp.net/learn/moving-to-asp.net-2.0/module-02.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;But, I have read plenty of material on the Internet that says that async methods (that start with Begin), or async pages can be used to accomplish background tasks and they do not block the UI shown to user.&lt;/p&gt;
&lt;p&gt;Can someone please clarfiy in very simple words????/&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description></item><item><title>IHttpAsynchandler: Asynchronous programming issue</title><link>http://forums.asp.net/thread/2923921.aspx</link><pubDate>Sat, 07 Feb 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2923921</guid><dc:creator>betamax</dc:creator><description>&lt;p&gt;Hello all,&lt;/p&gt;
&lt;p&gt;I have been trying to learn async programming model in ASP.NET and was following the article at &lt;a href="http://msdn.microsoft.com/en-us/magazine/cc163463.aspx"&gt;http://msdn.microsoft.com/en-us/magazine/cc163463.aspx&lt;/a&gt;&amp;nbsp;(Figure 2). The article states to set Page directive async attribute to true and add async=true; to connection string. I did both of these, copied the code and ran it. However, the task does not run asynchronously. There is a delay in page rendering and the page only outputs to browser when query has completed. I added a WAITFOR DELAY sql to the SELECT QUERY to simulate a network delay. Here is the code:&lt;/p&gt;
&lt;p&gt;using System;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Data.SqlClient;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using System.Web.Configuration;&lt;/p&gt;
&lt;p&gt;public partial class AsyncDataBind : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private SqlConnection _connection;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private SqlCommand _command;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private SqlDataReader _reader;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!IsPostBack)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddOnPreRenderCompleteAsync(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new BeginEventHandler(BeginAsyncOperation),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new EndEventHandler(EndAsyncOperation)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IAsyncResult BeginAsyncOperation (object sender, EventArgs e,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AsyncCallback cb, object state)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string connect = WebConfigurationManager.ConnectionStrings&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&amp;quot;AsyncPubs&amp;quot;].ConnectionString;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _connection = new SqlConnection(connect);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _connection.Open();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _command = new SqlCommand(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;quot;SELECT title_id, title, price FROM titles&amp;quot;, _connection);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return _command.BeginExecuteReader (cb, state);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; void EndAsyncOperation(IAsyncResult ar)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _reader = _command.EndExecuteReader(ar);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void Page_PreRenderComplete(object sender, EventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Output.DataSource = _reader;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Output.DataBind();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override void Dispose()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (_connection != null) _connection.Close();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; base.Dispose();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The code obviously works since it is taken from MSDN Magazine. But, from what I understand about async, the page should render without delay and the query should continue executing on another thread in the background. when the query finishes execution, results can be displayed. So, the part where async operations are suppoed to return immediately IS NOT WORKING. I have tried numerous examples on async programming model but none have worked so far in my case. &lt;/p&gt;
&lt;p&gt;Are there other settings that I need to set? Does this work on Visual Studio itself or do i need to run through IIS? &lt;strong&gt;OR, is it supposed to be like this and I have the whole concept of async programming incorrect????&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Please do let me know as I have spent weeks on learning this and whenever I run an example I seem to be doing it synchronously.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Thanks&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Re: Asynchronous Loading Web Part with &amp;quot;Loading..&amp;quot; Message</title><link>http://forums.asp.net/thread/2912405.aspx</link><pubDate>Tue, 03 Feb 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2912405</guid><dc:creator>Stefan Bookholt</dc:creator><description>&lt;p&gt;I use the following approach: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create a user control, which will be hosted in a smartpart with ajax later &lt;/li&gt;
&lt;li&gt;Insert an updatepanel &lt;/li&gt;
&lt;li&gt;Place a timer (ajax control) inside that panel with an interval of 1. This generates a postback every millisecond&lt;/li&gt;
&lt;li&gt;In the code behind, you can render your control in an &amp;quot;if (IsPostBack)&amp;quot; statement. Remove the timer in this statement (this.Controls.Remove(Timer)) &lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;You can put a Multiview with 2 views inside the update panel to easily switch between the loading view and the control itself.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve blogged about this (in dutch, but with code examples) at &lt;a class="" title="software-innovators" href="http://www.software-innovators.nl/2009/02/02/async-renderen-van-sharepoint-webparts/" target="_blank"&gt;http://www.software-innovators.nl/2009/02/02/async-renderen-van-sharepoint-webparts/&lt;/a&gt; You&amp;#39;ll need the ajax 1.0 templates when using VS2008: &lt;a class="" title="Ajax 1.0 templates VS 2008" href="http://www.microsoft.com/downloads/details.aspx?familyid=5C7DF430-1C34-40D2-B6EC-81353B5FCF2E&amp;amp;displaylang=en" target="_blank"&gt;http://www.microsoft.com/downloads/details.aspx?familyid=5C7DF430-1C34-40D2-B6EC-81353B5FCF2E&amp;amp;displaylang=en&lt;/a&gt; Hope it helps...&lt;/p&gt;</description></item><item><title>Response.Redirect on Session TimeOut</title><link>http://forums.asp.net/thread/2838157.aspx</link><pubDate>Tue, 30 Dec 2008 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2838157</guid><dc:creator>bfancett</dc:creator><description>&lt;p&gt;This is a hot topic and the web is filled with posts about this, but none of the solutions that I have seen are what I would consider to be good.&amp;nbsp; My Session Timeout is configured in my Web.Config as follows:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;pre class="coloredcode"&gt;&amp;lt;&lt;span class="tag"&gt;sessionState&lt;/span&gt;&lt;span class="attr"&gt; timeout=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;60&amp;quot;&lt;/span&gt;/&amp;gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;There has to be a way to set a redirect in the MasterPage or preferrably the Global.asax page to automatically detect when the session has expired.&amp;nbsp; I am not using cookies, and cannot as this is a government project.&amp;nbsp; I do not want to create a new class with HTTP Session state checking in it that gets embedded to each page either.&amp;nbsp; How can this be accomplish with limited code, and only placed in one spot?&lt;/p&gt;
&lt;p&gt;Any thoughts would be great.&lt;/p&gt;
&lt;p&gt;Thank you,&lt;/p&gt;
&lt;p&gt;Brian&lt;/p&gt;</description></item><item><title>MaintainScrollPositionOnPostBack Not working with AJAX on the Page</title><link>http://forums.asp.net/thread/2753463.aspx</link><pubDate>Tue, 18 Nov 2008 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2753463</guid><dc:creator>bfancett</dc:creator><description>&lt;p&gt;I have an aspx page (.NET 3.5 VS 2008) with 2 Update Panels.&amp;nbsp; I have a GridView Control that when the Selected Index is changed all of my textboxes are populated with data from an ADO.NET DataReader based on the content in a few of the cell in the GridViews selected Row.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;No matter what I do, whether I put the MaintainScrollPosisitionOnPostBack = true in the aspx Page, in my Web.Config or on the C# side, everything there is a postback I loose my scroll posisiton.&amp;nbsp; Without AJAX on the page everything works fine.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;What is the reason for this and what is the resolution.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks in advance!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Brian&lt;/p&gt;</description></item><item><title>How to determine whether a Control is being rendered within an UpdatePanel</title><link>http://forums.asp.net/thread/2636235.aspx</link><pubDate>Mon, 22 Sep 2008 04:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2636235</guid><dc:creator>priccopricco</dc:creator><description>&lt;p&gt;Hi everyone,&lt;br /&gt;I have a Web User Control which is used in three different scenario:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Used in a page with no UpdatePanel&lt;/li&gt;&lt;li&gt;Used in a page within an UpdatePanel&lt;/li&gt;&lt;li&gt;Used in a page that has some UpdatePanels but this WebUserControl isn&amp;#39;t whithin an UpdatePanel&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Before the WebUserControl is rendered it gets some data from db and then is databound.&lt;/p&gt;&lt;p&gt;To optimize the performance and reduce to the minimum the db-access, I&amp;#39;d like to determine wheter the rendering of the control (and therefore the access to db) is necessary or not.&lt;/p&gt;&lt;p&gt;In fact in the case 1 and 2 it needs to be databound and rendered, but in the case 3 no.&lt;/p&gt;&lt;p&gt;With the ScriptManager IsInAsyncPostBack we can check if the Page is being partially rendered, but we have no information about which controls are actually delivered to the client.&lt;/p&gt;&lt;p&gt;So the question: is there a way to determine if a control is actually included in the UpdatePanel that is being rendered in a AsyncPostBack?&lt;/p&gt;&lt;p&gt;Thank you very much in advance for any suggestion! &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>