This is a migrated thread and some comments may be shown as answers.

Page is taking too much time on save button.

1 Answer 27 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ashhar
Top achievements
Rank 2
Ashhar asked on 24 Aug 2012, 10:29 AM

Page is taking almost 15 seconds to save data.
When I Upload the site eventually it takes almost unlimited time to save the data.
By doing enableviewstate="false" at page level, it saves the record very fast but obviously it didn't update the records because of enableviewstate="false".
Then I do enableviewstate="true" in Grid. But it is not working.
Can you help me please ?? Is there a solution like only changed values save in viewstate otherwise it will be enableviewstate="true"
Following is my HTML Code:

<%@ OutputCache Duration="10" VaryByParam="none" %>
<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPages/AdminMaster.master"
    EnableEventValidation="false" AutoEventWireup="false" CodeFile="EmployeeDeductions.aspx.vb"
    Inherits="Admin_EmployeeDeductions" %>
 
<%@ Register Src="~/ECZ_FooterMessage.ascx" TagName="FooterMessage" TagPrefix="Ecz" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <Ecz:FooterMessage ID="msg" runat="server" />
            <table width="378" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="30" align="left" valign="top">
                        <img src="../images/top_left.jpg" width="30" height="43" />
                    </td>
                    <td align="left" valign="middle" id="top_bg">
                        <asp:Label ID="lblHeading" runat="server" Text="     Employee Deductions" CssClass="heading"></asp:Label>
                    </td>
                    <td width="30" align="right" valign="top">
                        <img src="../images/top_right.jpg" width="30" height="43" />
                    </td>
                </tr>
                <tr>
                    <td align="left" valign="top">
                          
                    </td>
                    <td align="left" valign="top">
                        <img src="../images/top_shadow.jpg" width="322" height="16" />
                    </td>
                    <td align="right" valign="top">
                          
                    </td>
                </tr>
            </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td align="right">
                        Date:
                    </td>
                    <td>
                        <telerik:RadDatePicker ID="radDate_cr" runat="server">
                        </telerik:RadDatePicker>
                        <asp:Button ID="btnSearch" runat="server" Text="Search" />
                        
                    </td>
                    <td>
                        <asp:Button ID="btnPost" runat="server" Text="Post" />
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td align="center">
                        <br />
                        <br />
                    </td>
                </tr>
            </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td>
                        <telerik:RadGrid ID="grdEmployeeDeductions" AllowSorting="True" runat="server" AllowFilteringByColumn="True"
                            ShowStatusBar="True" GridLines="None" AutoGenerateColumns="False" Visible="false"
                            Width="100%">
                            <MasterTableView DataKeyNames="E_EmployeeContract_ID_PK" ClientDataKeyNames="E_EmployeeContract_ID_PK">
                                <Columns>
                                    <telerik:GridTemplateColumn DataField="E_EmployeeContract_ID_FK" HeaderText="Employee">
                                        <ItemTemplate>
                                            <asp:Label ID="lblE_EmployeeContract_ID_FK" runat="server" Text='<%# Eval("E_EmployeeContract_ID_PK") %>'
                                                Visible="false"></asp:Label>
                                            <asp:Label ID="lblEmployeeName" runat="server" Text='<%# Eval("E_EmployeeName") %>'></asp:Label>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn DataField="Company" HeaderText="Company">
                                        <ItemTemplate>
                                            <asp:Label ID="lblCompanyID" runat="server" Text='<%# Eval("E_Company_ID_FK") %>'
                                                Visible="false"></asp:Label>
                                            <asp:Label ID="lblCompany" runat="server" Text='<%# Eval("CompanyName") %>'></asp:Label>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn DataField="Department" HeaderText="Department" UniqueName="Department">
                                        <ItemTemplate>
                                            <asp:Label ID="lblDepartmentID" runat="server" Text='<%# Eval("E_Department_ID_FK") %>'
                                                Visible="false"></asp:Label>
                                            <asp:Label ID="lblDepartment" runat="server" Text='<%# Eval("DepartmentName") %>'></asp:Label>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn DataField="GOSI" HeaderText="GOSI" UniqueName="GOSI"
                                        FilterControlWidth="50px">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtGOSI" runat="server" Text='<%# Eval("gosi") %>' Width="50px"></asp:TextBox>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="GOSI Account">
                                        <ItemTemplate>
                                            <telerik:RadComboBox ID="cmbGOSIAccount" runat="server" OnDataBound="CmbAccountDataBound1"
                                                Filter="Contains">
                                            </telerik:RadComboBox>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn DataField="Social" HeaderText="Social" FilterControlWidth="50px">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtSocial_Deduction" runat="server" Width="50px" Text='<%# Eval("Social_deduction") %>'></asp:TextBox>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="Social Account">
                                        <ItemTemplate>
                                            <telerik:RadComboBox ID="cmbSocialAccount" runat="server" OnDataBound="CmbAccountDataBound1"
                                                Filter="Contains">
                                            </telerik:RadComboBox>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn DataField="Advance" HeaderText="Advance" FilterControlWidth="50px">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtAdvance" runat="server" Width="50px" Text='<%# Eval("Advance") %>'></asp:TextBox>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="advance account">
                                        <ItemTemplate>
                                            <telerik:RadComboBox ID="RadComboAdv" runat="server" OnDataBound="CmbAccountDataBound1">
                                            </telerik:RadComboBox>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn DataField="Absent" HeaderText="Absent" FilterControlWidth="50px">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtAbsent" runat="server" Width="50px" Text='<%# Eval("Absent") %>'></asp:TextBox>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="absent account">
                                        <ItemTemplate>
                                            <telerik:RadComboBox ID="RadComboBoxAbsnt" runat="server" OnDataBound="CmbAccountDataBound1">
                                            </telerik:RadComboBox>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                </Columns>
                            </MasterTableView>
                        </telerik:RadGrid>
                    </td>
                </tr>
                <tr>
                    <td>
                        <br>
                    </td>
                </tr>
                <tr>
                    <td align="center">
                     <asp:Button ID="btnSave" runat="server" Text="Save"  Visible="false"/>
                        <%--<asp:Button ID="btnSave" runat="server" Text="Save" Visible="False" OnClientClick="return verify_form('form',0)" />
                        --%>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:UpdateProgress ID="UpdateProgress1" runat="server">
                            <ProgressTemplate>
                                <img src="../images/wait.gif" alt="dd" />
                            </ProgressTemplate>
                        </asp:UpdateProgress>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

1 Answer, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 29 Aug 2012, 08:38 AM
Hi,

 The markup of the grid looks okay, but I did not see the editing feature enabled there. The grid has neither edit column nor EditTemplate for the GridTemaplteColumns. Do you have any code on the server that puts the grid in edit mode and how exactly do you extract and save the data?

Greetings,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
General Discussions
Asked by
Ashhar
Top achievements
Rank 2
Answers by
Marin
Telerik team
Share this question
or