Hi all,
We are currently using Dynamic Data website for one of our project. we have found that Insert page was taking much time to load and on analysis we have found the LINQ datasource is fetching all the records for the current table when the insert page is loaded. I have found this through OnSelected event of LINQ datasource on the Insert page.
ASPX <%@ Page Language="C#" MasterPageFile="~/Site.master" CodeFile="Insert.aspx.cs" Inherits="Insert" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:DynamicDataManager ID="DynamicDataManager1" runat="server" AutoLoadForeignKeys="true" />
<h2>Add new entry to table <%= table.DisplayName %></h2>
<asp:ScriptManagerProxy runat="server" ID="ScriptManagerProxy1" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:ValidationSummary ID="ValidationSummary1" runat="server" EnableClientScript="true"
HeaderText="List of validation errors" />
<asp:DynamicValidator runat="server" ID="DetailsViewValidator" ControlToValidate="DetailsView1" Display="None" />
<asp:DetailsView ID="DetailsView1" runat="server" DataSourceID="DetailsDataSource" DefaultMode="Insert"
AutoGenerateInsertButton="True" OnItemCommand="DetailsView1_ItemCommand" OnItemInserted="DetailsView1_ItemInserted"
CssClass="detailstable" FieldHeaderStyle-CssClass="bold">
</asp:DetailsView>
<asp:LinqDataSource ID="DetailsDataSource" runat="server" EnableInsert="true"
onselected="DetailsDataSource_Selected">
</asp:LinqDataSource>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
protected void DetailsDataSource_Selected(object sender, LinqDataSourceStatusEventArgs e)
{
\\ e.Result is fetching some 76k record from DB
}
How do we prevent this ? is this by design??
Any idea??