在Asp.net中,Ajax更新面板太慢了。怎么解决?

时间:2012-09-11 01:27:21

标签: asp.net ajax updatepanel

我只是在我的RadioButtonList中的selectedindexchanged期间更新在Hyperlink的NavigateURL中传递的ID。

在Mozilla中,ID在Hyperlink中更新需要3.26秒 其他浏览器也需要很长时间。

我该如何解决这个问题?

我阅读了很多文章并采取了以下措施:

在web.config中将Debug设置为false

在更新模式下使用条件

仅使用“更新”面板中必须更新的控件。

但是,它还需要3.26秒......

Protected Sub chlTypes_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles chlTypes.SelectedIndexChanged
    If (chlTypes.SelectedItem.Value.ToString() <> "") And (chlTypes.SelectedItem.Value.ToString() <> "0") Then
        HypView.NavigateUrl = "~/Content.aspx?ID=" + chlTypes.SelectedItem.Value.ToString()
    End If 
End Sub

 <table id="tbl1">
                <tr>
                    <td>
                        <asp:UpdatePanel ID="UP1" runat="server"  UpdateMode="Conditional">
                            <ContentTemplate>
                                <asp:RadioButtonList ID="chlTypes" runat="server" AutoPostBack="true">
                                </asp:RadioButtonList>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <asp:UpdatePanel ID="UP2"  runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                <div class="caregiver_view_button">
                                    <asp:HyperLink ID="HypView" class="caregiver_view_button"   
                                     runat="server"><img src="/view_button.png" /></asp:HyperLink>

                                </div>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="chlTypes" />
                            </Triggers>
                        </asp:UpdatePanel> 
                    </td>
                </tr>
            </table>

0 个答案:

没有答案