C# 使用Listview更新面板回发
我在accordian控件中有一个更新面板,有两件事会导致异步回发: 1当我单击图像按钮时 2我点击页面 这两种方法都很好,但总是会导致完全回发C# 使用Listview更新面板回发,c#,asp.net,ajaxcontroltoolkit,C#,Asp.net,Ajaxcontroltoolkit,我在accordian控件中有一个更新面板,有两件事会导致异步回发: 1当我单击图像按钮时 2我点击页面 这两种方法都很好,但总是会导致完全回发 <asp:UpdatePanel ID="updListView" runat="server" ChildrenAsTriggers="True"> <ContentTemplate> <asp:ListView ID="dlNewLeads" runat="ser
<asp:UpdatePanel ID="updListView" runat="server" ChildrenAsTriggers="True">
<ContentTemplate>
<asp:ListView ID="dlNewLeads" runat="server" DataSourceID="sdsLeads" OnItemCommand="dlNewLeads_OnItemCommand">
<ItemTemplate>
<table style="width: 642px;">
<tr>
<td style="width: 421px;">
<asp:Label ID="lblTitle" runat="server" Text="Name" class="repeater-title"></asp:Label><br/>
</td>
<td style="width: 421px;">
<asp:Label ID="Label3" runat="server" Text="Phone" class="repeater-title"></asp:Label><br/>
</td>
<td style="width: 421px;">
<asp:Label ID="Label1" runat="server" Text="Time of Lead" class="repeater-title"></asp:Label><br/>
</td>
</tr>
<tr>
<td style="width: 421px;">
<asp:linkbutton ClientIDMode="AutoID" ID="btnRem" CommandName="SetAsContacted" runat="server" causesvalidation="false" commandargument='<%# Eval("Id") %>'>
<asp:image id="Image2" runat="server" imageurl="~/Images/x.jpg"/>
</asp:linkbutton> <asp:HyperLink Text='<%# Eval("FullName") %>' NavigateUrl='<%# GetLink(Eval("ID").ToString()) %>' runat="server"></asp:HyperLink>
</td>
<td style="width: 421px;">
<asp:Label ID="Label4" runat="server" Text='<%# Eval("Phone") %>' class="repeater-text"></asp:Label>
</td>
<td style="width: 421px;"><asp:Label ID="Label2" runat="server" Text='<%# Eval("TimeOfLead") %>' class="repeater-text"></asp:Label>
<td style="max-width: 76px; min-width: 76px;">
</td><br/>
</td>
</tr>
</table>
<div style="background-color: #dae5e7; height: 1px; width: 590px;"></div>
<br/>
</ItemTemplate>
</asp:ListView>
<asp:DataPager ID="DataPager1" runat="server" PagedControlID="dlNewLeads" PageSize="5">
<Fields>
<asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowLastPageButton="True"/>
</Fields>
</asp:DataPager>
</ContentTemplate>
</asp:UpdatePanel>
来看看,是我的web.config文件中的某些东西导致了它。我不知道具体是哪一行,所以我无法向任何人提供解决方案 我用备份文件替换了我昨晚更改的web.config文件,该文件立即生效
<asp:SqlDataSource ID="sdsLeads" runat="server" ConnectionString="<%$ ConnectionStrings:SjkConnectionString %>" SelectCommand="SELECT [Id], [FullName], [TimeOfLead], [Phone] FROM [RequestContacts] WHERE (([IsAnswered] = @IsAnswered) AND ([Id] = @Id))">
<SelectParameters>
<asp:Parameter DefaultValue="False" Name="IsAnswered" Type="Boolean" />
<asp:Parameter DefaultValue="0" Name="Id" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
If(!IsPostBack)
sdsLeads.SelectParameters["Id"].DefaultValue = locationId.ToString();