当autopostback = true时,OutofMemory Exception Dropdownlist

时间:2010-04-19 14:18:41

标签: asp.net vb.net ajax ajaxcontroltoolkit

我有一个母版页,而不是包含我的ScriptManager。 在子页面上,我有一个更新的面板。 在更新面板中有一个下拉列表。 当我设置autopostback = true时,我得到OutofMemory Exceptions。 每时每刻。 还请注意我在web.config上设置了AjaxControlToolkit。

以下是我的代码的部分内容。

MasterPage.aspx

<ajax:ToolkitScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" ></ajax:ToolkitScriptManager>

儿童页面

<asp:UpdatePanel ID="upChTime" runat="server"><ContentTemplate>
        <table cellpadding="0" cellspacing="0">
           <tr>
                <td><asp:TextBox runat="server" ID="txChTimeClientCode" /></td>
                <td><asp:DropDownList runat="server" ID="dpChTimeClient" /></td>
           </tr>

因此,当我在DropdownList上设置AutoPostBack = True时,Visual Studio内部网络服务器变为500MB,我得到OutOfMemory异常。

评论后儿童页面代码

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    If Not IsPostBack Then
        PopulateLatestClients()
    End If
End Sub

Private Sub PopulateLatestClients()
    dpChTimeClient.DataSource = GetLatestClients()
    dpChTimeClient.DataTextField = "description"
    dpChTimeClient.DataValueField = "id"
    dpChTimeClient.DataBind()
    dpChTimeClient.Items.Insert(0, "")
End Sub

1 个答案:

答案 0 :(得分:0)

似乎GetLatestClients()返回太多项目。你检查过了吗?

相关问题