Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all articles
Browse latest Browse all 4356

Created Unassigned: AjaxControlToolkit 7.0123 breaks UpdatePanel asynchronous post-back [27394]

$
0
0
I have an ASP.NET Web Application built against ASP.NET 4.5 in VS2012. Within the application are a number of forms containing ListView controls which in turn contain UpdatePanel controls so that any edit that takes place or new data that is added is carried out asynchronously and not repeated if the user refreshes the page.

This worked fine until today. Today I added the latest version of the AjaxControlToolkit (7.0123) to the project using NuGet and carried out the modifications to the scripts etc. [as specified by Stephen Walther here][1].

Since the introduction of the AjaxControlToolkit to the project, the asynchronous post-backs appear to have become synchronous. If for example I edit an item in the ListView, when I then press F5 (in IE or Firefox) I am prompted that I will be resending the data.

The mark-up is pretty simple...

<asp:ListView ID="LocationList" runat="server" ItemType="Model.Location" DataKeyNames="ID" InsertItemPosition="LastItem" DeleteMethod="LocationList_DeleteMethod" InsertMethod="LocationList_InsertMethod" SelectMethod="LocationList_SelectMethod" UpdateMethod="LocationList_UpdateMethod">
<LayoutTemplate>
<asp:UpdatePanel ID="ListViewUpdatePanel" runat="server">
<ContentTemplate>
<table class="table table-condensed table-striped">
<thead>
<tr>
<th runat="server">
<asp:LinkButton ID="SortByDescription" runat="server" CommandName="Sort" CommandArgument="Name" Text="Description" />
</th>
<th></th>
</tr>
</thead>
<asp:PlaceHolder ID="itemPlaceholder" runat="server" />
</table>
</ContentTemplate>
</asp:UpdatePanel>
<div class="pagination align-center">
<asp:DataPager runat="server" />
</div>
</LayoutTemplate>
<ItemTemplate>
<tr>
<td>
<%#: Item.Name %>
</td>
<td>
<asp:LinkButton ID="Edit" runat="server" CommandName="<%#: Global.CommandNames.Edit %>" CommandArgument="<%#: Item.ID %>" Text="Edit" />
</td>
</tr>
</ItemTemplate>
<EditItemTemplate>
<tr>
<td>
<asp:TextBox ID="Description" runat="server" Text="<%#: BindItem.Name %>" />
</td>
<td>
<asp:LinkButton ID="Update" runat="server" CommandName="<%#: Global.CommandNames.Update %>" Text="Update" />
<asp:LinkButton ID="Cancel" runat="server" CommandName="<%#: Global.CommandNames.Cancel %>" Text="Cancel" />
</td>
</tr>
</EditItemTemplate>
<InsertItemTemplate>
<tr>
<td>
<asp:TextBox ID="Description" runat="server" Text="<%#: BindItem.Name %>" />
</td>
<td>
<asp:LinkButton ID="Insert" runat="server" CommandName="<%#: Global.CommandNames.Insert %>" Text="Add" />
</td>
</tr>
</InsertItemTemplate>
</asp:ListView>

The mark-up provided is within a ContentPanel and the page uses a MasterPage. The MasterPage has the ToolkitScriptManager control as outlined above.

As I have already stated, this worked fine prior to installing the AjaxControlToolkit.

I have also tried changing the layout of the page in as much as moving the UpdatePanel outside of the entire ListView (and then placing the pager under the UpdatePanel); this made no difference.

I am at a total loss as to what can be causing this other than some compatibility and/or configuration issue involving the AjaxControlToolkit. I have found other references to similar problems but I have yet to find any solution that work (for example, there are articles that indicate problems when using static client id's but as you will see from the mark-up provided I have already tried removing these and it makes no difference).

Just to add, I have also tried running this with the developer tools showing the console tab. There are no JavaScript errors being shown (nor any other errors for that matter). I have also found that I can intercept the ItemCreated event from the ListView and if I then use ScriptManager.RegisterAsyncPostBackControl against each of the LinkButton controls then the original functionality is restored. Whilst this is a work-around, I do not see however why it should be necessary when it was not required originally.

Note: I have also raised this on [StackOverflow](http://stackoverflow.com/questions/15852271/ajaxcontroltoolkit-7-0123-breaks-updatepanel-asynchronous-post-back).


[1]: http://stephenwalther.com/archive/2012/09/20/september-2012-release-of-the-ajax-control-toolkit.aspx


Viewing all articles
Browse latest Browse all 4356

Trending Articles