开发者

OutofMemory Exception Dropdownlist when autopostback=true

开发者 https://www.devze.com 2022-12-27 15:19 出处:网络
I have a master page than contains my ScriptManager. On a child page i have an updated panel. Inside the update panel there is a dropdowlist.

I have a master page than contains my ScriptManager. On a child page i have an updated panel. Inside the update panel there is a dropdowlist. When i set the autopostback=true i get OutofMemory Exceptions. All the time. Please also note that I have AjaxControlToolkit set on my web.config.

Here is parts of my Code.

MasterPage.aspx

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

Child Page

<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>

So when i s开发者_运维知识库et the AutoPostBack=True on the DropdownList the Visual Studio internal webserver goes to 500MB and i get a OutOfMemory Exception.

After a comment Child Page Code Behind

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


It seem that GetLatestClients() return too much items. Have you checked that?

0

精彩评论

暂无评论...
验证码 换一张
取 消