Click to See Complete Forum and Search --> : How to do integration of HTML5 with ASP.Net to reduce response time of server
javascriptdb
01-18-2012, 03:28 AM
Hello All,
I need to integrate html5 with ASP.Net to reduce the response time of server and to store the data in server locally (cahing) in web database. Please help me to do this.
Thanking you
ssystems
01-19-2012, 08:52 PM
Show us what you got. It doesn't really matter what doctype you use. It's a matter of how you load the objects. E.g. Compartmentalize your data and just use partial postback and delay loading.
javascriptdb
01-21-2012, 01:04 AM
@ssystems .. There is a asp page having controls like textbox, label, dropdown lists and grid..... the page loading data slowly in grid and when fetching details from grid.... so we plan to use web database to load the data very first while loading page ..... so please do guide how to process that.... whether have to use html5 controls?
ssystems
01-21-2012, 08:53 PM
Without knowing what you got we will have a hard time helping you. You have to help us help you. In optimizing applications it is always imperative to identify the actual bottleneck. Put logging for start time and end time of each method or step if you need to. I don't see any benefit in changing the doctype (switching to html5) as it is independent on how .NET page life cycle works. When you say to load the data very first while loading the page could mean anything to me. Do you mean you're loading it in pre-init? init? or are you just referring to non postback?
In any case consider this implementation.
App_Code/BasePage.cs
using System;
using System.Web.UI;
namespace App_Code
{
/// <summary>
/// Summary description for BasePage
/// </summary>
public class BasePage : Page
{
protected override void OnLoad(EventArgs e)
{
if (!IsPostBack)
OnInitialLoad();
base.OnLoad(e);
}
protected virtual void OnInitialLoad()
{
}
}
}
Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager runat="server"></asp:ScriptManager>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:GridView runat="server" ID="List1">
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:GridView runat="server" ID="List2">
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>
Default.aspx.cs
using System;
using System.Web.UI.WebControls;
using App_Code;
public partial class Default : BasePage
{
protected override void OnInitialLoad()
{
base.OnInitialLoad();
GetData();
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
List1.PageIndexChanging += List1PageIndexChanging;
List2.PageIndexChanging += List2PageIndexChanging;
}
protected void List1PageIndexChanging(Object sender, GridViewPageEventArgs e)
{
//Process
GetList1();
}
protected void List2PageIndexChanging(Object sender, GridViewPageEventArgs e)
{
//Process
GetList2();
}
protected void GetData()
{
GetList1();
GetList2();
}
protected void GetList1()
{
//Process DB Calls
}
protected void GetList2()
{
//Process DB Calls
}
}
You'll see that the implementation employs that the calls to the db are compartmentalized and only when needed. There are other methods you can employ but without knowing what you have it's pretty hard to give a real recommendation. Again it doesn't matter what doctype it is.