<%@ Page Language="C#" %>
<%@ Import Namespace="System.Diagnostics" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
    Stopwatch watch = new Stopwatch();
    protected void Page_Init(object sender, EventArgs e)
    {
        watch.Reset();
        watch.Start();
    }

    protected override void Render(HtmlTextWriter writer)
    {
        watch.Stop();

        string message = String.Format("alert('Total records: {0}, Total time: {1} ms');", 
            RadGrid1.Items.Count, watch.ElapsedMilliseconds.ToString());

        RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "alert", message, true);

        base.Render(writer);
    }
    
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
        <telerik:RadGrid ID="RadGrid1" DataSourceID="LinqDataSource1" runat="server" />
    </div>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="DataClassesDataContext"
        TableName="Order_Details">
    </asp:LinqDataSource>
    </form>
</body>
</html>
