2010-04-19 33 views
0

我有一個母版頁,而不是包含我的ScriptManager。 在兒童頁面我有一個更新的面板。 在更新面板中有一個下拉列表。 當我設置autopostback = true時,我得到OutofMemory異常。 所有的時間。 請注意,我在我的web.config上設置了AjaxControlToolkit。OutofMemory異常下拉列表autopostback = true時

這是我的代碼的一部分。

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> 

所以,當我設置的AutoPostBack =真在下拉列表中的Visual Studio內部Web服務器去爲500MB,我也得到了一個內存溢出異常。

註釋子頁代碼後背後

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

你是如何設置ddl的數據源的? – alejandrobog 2010-04-19 14:21:31

回答

0

這似乎是GetLatestClients()返回太多的項目。你檢查過了嗎?

+0

這是TOP 25記錄的選擇。數據不多。 – Constandinos 2010-04-19 14:29:17