How to create Auto Refresh pages in Asp .NET using C#?

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MetaTag.aspx.cs" Inherits="MetaTag" %>

<!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>
    <meta http-equiv="refresh" content="0.5">
    <%--content="30" is for 30 Seconds--%>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="lblCount" runat="server" Text=""></asp:Label>
    </div>
    </form>
</body>
</html>
.............................
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class MetaTag : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Convert.ToString(Session["count"]) == "")
                Session["count"] = 0;
            else
                Session["count"] = Convert.ToInt32(Session["count"]) + 1;
            lblCount.Text = Convert.ToString(Session["count"]) + " time page refresh";
            Response.Write("kul");
        }
    }
}

..............................second......................
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="JavaScript.aspx.cs" Inherits="JavaScript" %>

<!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 id="Head1" runat="server">
    <title></title>

    <script type="text/javascript" language="javascript">

        var idleInterval = setInterval("reloadPage()", 1000); // 30 Seconds

        function reloadPage() {
            location.reload();
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="lblCount" runat="server" Text=""></asp:Label>
    </div>
    </form>
</body>
</html>
...........................................
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class JavaScript : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Convert.ToString(Session["count"]) == "")
                Session["count"] = 0;
            else
                Session["count"] = Convert.ToInt32(Session["count"]) + 1;
            lblCount.Text = Convert.ToString(Session["count"]) + " time page refresh";
        }
    }
}
..................................third...................................
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="JQuery.aspx.cs" Inherits="JQuery" %>

<!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 id="Head1" runat="server">
    <title></title>

    <script type="text/javascript" language="Javascript" 
        src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>

    <script type="text/javascript" language="javascript">

        $(document).ready(function() {
            var idleInterval = setInterval("reloadPage()", 1000); // 30 Seconds
        })

        function reloadPage() {
            location.reload();
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="lblCount" runat="server" Text=""></asp:Label>
    </div>
    </form>
</body>
</html>
................................
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class JQuery : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Convert.ToString(Session["count"]) == "")
                Session["count"] = 0;
            else
                Session["count"] = Convert.ToInt32(Session["count"]) + 1;
            lblCount.Text = Convert.ToString(Session["count"]) + " time page refresh";
        }
    }
}

Share:

Tuesday, 12 January 2016

How to create Auto Refresh pages in Asp .NET using C#?

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MetaTag.aspx.cs" Inherits="MetaTag" %>

<!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>
    <meta http-equiv="refresh" content="0.5">
    <%--content="30" is for 30 Seconds--%>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="lblCount" runat="server" Text=""></asp:Label>
    </div>
    </form>
</body>
</html>
.............................
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class MetaTag : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Convert.ToString(Session["count"]) == "")
                Session["count"] = 0;
            else
                Session["count"] = Convert.ToInt32(Session["count"]) + 1;
            lblCount.Text = Convert.ToString(Session["count"]) + " time page refresh";
            Response.Write("kul");
        }
    }
}

..............................second......................
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="JavaScript.aspx.cs" Inherits="JavaScript" %>

<!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 id="Head1" runat="server">
    <title></title>

    <script type="text/javascript" language="javascript">

        var idleInterval = setInterval("reloadPage()", 1000); // 30 Seconds

        function reloadPage() {
            location.reload();
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="lblCount" runat="server" Text=""></asp:Label>
    </div>
    </form>
</body>
</html>
...........................................
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class JavaScript : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Convert.ToString(Session["count"]) == "")
                Session["count"] = 0;
            else
                Session["count"] = Convert.ToInt32(Session["count"]) + 1;
            lblCount.Text = Convert.ToString(Session["count"]) + " time page refresh";
        }
    }
}
..................................third...................................
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="JQuery.aspx.cs" Inherits="JQuery" %>

<!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 id="Head1" runat="server">
    <title></title>

    <script type="text/javascript" language="Javascript" 
        src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>

    <script type="text/javascript" language="javascript">

        $(document).ready(function() {
            var idleInterval = setInterval("reloadPage()", 1000); // 30 Seconds
        })

        function reloadPage() {
            location.reload();
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="lblCount" runat="server" Text=""></asp:Label>
    </div>
    </form>
</body>
</html>
................................
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class JQuery : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Convert.ToString(Session["count"]) == "")
                Session["count"] = 0;
            else
                Session["count"] = Convert.ToInt32(Session["count"]) + 1;
            lblCount.Text = Convert.ToString(Session["count"]) + " time page refresh";
        }
    }
}

Popular

Total Pageviews

Archive