當我將ASP.Net Formview從只讀模式切換到編輯模式時,它需要超過6秒(從編輯到只讀需要一秒鐘)。 我不知道它是什麼原因。 EditItemTemplate包含很多控件(表格,文本框,下拉列表),但實際上不超過ItemTemplate。然而,我甚至評論了完整的FormView.DataBound,其中的控件是有限的數據,但沒有顯着的變化。我的ASP.Net Web Apllication使用Ajax,Formview完全嵌套在UpdatePanel中。 對此行爲有何建議或假設?切換到FormViewMode.Edit非常慢
編輯: 我已經從EditItemtemplate中刪除了所有Ajax控件,現在它的執行速度與Itemtemplate一樣快。可能是什麼原因呢?以下控件刪除:
<act:ValidatorCalloutExtender ID="NoDeliveryNoteValidatorExtenderEdit" BehaviorID="NoDeliveryNoteValidatorExtenderEdit" runat="server" TargetControlID="NoDeliveryNoteValidatorEdit" Width="150px" HighlightCssClass="highlight" WarningIconImageUrl="~/images/warning.gif" CloseImageUrl="~/images/close.gif" />
<act:ValidatorCalloutExtender ID="NoArrivalAtValidatorExtenderEdit" BehaviorID="NoArrivalAtValidatorExtenderEdit" runat="server" TargetControlID="NoArrivalAtValidatorEdit" Width="150px" HighlightCssClass="highlight" WarningIconImageUrl="~/images/warning.gif" CloseImageUrl="~/images/close.gif" />
<act:ValidatorCalloutExtender ID="ArrivalAtValidatorExtenderEdit" BehaviorID="ArrivalAtValidatorExtenderEdit" PopupPosition="right" runat="server" TargetControlID="ArrivalAtValidatorEdit" Width="150px" HighlightCssClass="highlight" WarningIconImageUrl="~/images/warning.gif" CloseImageUrl="~/images/close.gif" />
<act:ValidatorCalloutExtender ID="NoPalletCountValidatorExtenderEdit" BehaviorID="NoPalletCountValidatorExtenderEdit" PopupPosition="right" runat="server" TargetControlID="NoPalletCountValidatorEdit" Width="150px" HighlightCssClass="highlight" WarningIconImageUrl="~/images/warning.gif" CloseImageUrl="~/images/close.gif" />
<act:ValidatorCalloutExtender ID="PalletCountIntegerValidatorExtenderEdit" BehaviorID="PalletCountIntegerValidatorExtenderEdit" PopupPosition="right" runat="server" TargetControlID="PalletCountIntegerValidatorEdit" Width="150px" HighlightCssClass="highlight" WarningIconImageUrl="~/images/warning.gif" CloseImageUrl="~/images/close.gif" />
<act:ValidatorCalloutExtender ID="NoWeightInValidatorExtenderEdit" BehaviorID="NoWeightInValidatorExtenderEdit" PopupPosition="right" runat="server" TargetControlID="NoWeightInValidatorEdit" Width="150px" HighlightCssClass="highlight" WarningIconImageUrl="~/images/warning.gif" CloseImageUrl="~/images/close.gif" />
<act:ValidatorCalloutExtender ID="WeightInIntegerValidatorExtenderEdit" BehaviorID="WeightInIntegerValidatorExtenderEdit" PopupPosition="right" runat="server" TargetControlID="WeightInIntegerValidatorEdit" Width="150px" HighlightCssClass="highlight" WarningIconImageUrl="~/images/warning.gif" CloseImageUrl="~/images/close.gif" />
<act:ValidatorCalloutExtender ID="WeightOutIntegerValidatorExtenderEdit" BehaviorID="WeightOutIntegerValidatorExtenderEdit" PopupPosition="right" runat="server" TargetControlID="WeightOutIntegerValidatorEdit" Width="150px" HighlightCssClass="highlight" WarningIconImageUrl="~/images/warning.gif" CloseImageUrl="~/images/close.gif" />
<act:ValidatorCalloutExtender ID="NoCountInValidatorExtenderEdit" BehaviorID="NoCountInValidatorExtenderEdit" PopupPosition="right" runat="server" TargetControlID="NoCountInValidatorEdit" Width="150px" HighlightCssClass="highlight" WarningIconImageUrl="~/images/warning.gif" CloseImageUrl="~/images/close.gif" />
<act:ValidatorCalloutExtender ID="CountInIntegerValidatorExtenderEdit" BehaviorID="CountInIntegerValidatorExtenderEdit" PopupPosition="right" runat="server" TargetControlID="CountInIntegerValidatorEdit" Width="150px" HighlightCssClass="highlight" WarningIconImageUrl="~/images/warning.gif" CloseImageUrl="~/images/close.gif" />
<act:ValidatorCalloutExtender ID="CountOutIntegerValidatorExtenderEdit" BehaviorID="CountOutIntegerValidatorExtenderEdit" PopupPosition="right" runat="server" TargetControlID="CountOutIntegerValidatorEdit" Width="150px" HighlightCssClass="highlight" WarningIconImageUrl="~/images/warning.gif" CloseImageUrl="~/images/close.gif" />
<act:ValidatorCalloutExtender ID="NoRecipientValidatorExtenderEdit" BehaviorID="NoRecipientValidatorExtenderEdit" PopupPosition="right" runat="server" TargetControlID="NoRecipientValidatorEdit" Width="150px" HighlightCssClass="highlight" WarningIconImageUrl="~/images/warning.gif" CloseImageUrl="~/images/close.gif" />
<act:ValidatorCalloutExtender ID="NoChargeTypeValidatorExtenderEdit" BehaviorID="NoChargeTypeValidatorExtenderEdit" PopupPosition="right" runat="server" TargetControlID="NoChargeTypeValidatorEdit" Width="150px" HighlightCssClass="highlight" WarningIconImageUrl="~/images/warning.gif" CloseImageUrl="~/images/close.gif" />
<act:ValidatorCalloutExtender ID="NoCustomerValidatorExtenderEdit" BehaviorID="NoCustomerValidatorExtenderEdit" PopupPosition="right" runat="server" TargetControlID="NoCustomerValidatorEdit" Width="150px" HighlightCssClass="highlight" WarningIconImageUrl="~/images/warning.gif" CloseImageUrl="~/images/close.gif" />
<act:CalendarExtender ID="ArrivalAtExtenderEdit" runat="server" BehaviorID="ArrivalAtExtenderEdit" TargetControlID="TxtArrivalAtEdit"></act:CalendarExtender>
如此看來,我應該重新命名這個主題爲「ASP.NET AJAX:性能問題與增量控制」。
其實我的問題是,我在我的項目(3.0x)中有一箇舊的AjaxControlToolkit.dll引用。當我刪除它並添加更新(3.5倍)版本時,它的執行速度幾乎與沒有擴展器控件一樣快。
是的,這需要一段時間。但遠遠沒有我這麼做。我的問題是我的項目中的AjaxControlToolkit DLL的不正確引用(請參閱我的更新問題)。 無論如何,謝謝。 – 2010-06-16 12:28:35