Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Auto refresh without timer

Auto refresh without timer

Scheduled Pinned Locked Moved ASP.NET
cssdatabase
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    ShindeAR
    wrote on last edited by
    #1

    Hello Friends, I have one query,If i use a multi-user system in that on main page there is a dashboard consider it as a grid in that grid value of xyz table is displayed. As it is a multiuser system in that data can be inserted in that xyz table, if any user inserts data in the xyz table as soon as the user inserts the data the changes gets automatically reflected in main page dashboard. Just like mail systems of gmail and all.

    P L A 3 Replies Last reply
    0
    • S ShindeAR

      Hello Friends, I have one query,If i use a multi-user system in that on main page there is a dashboard consider it as a grid in that grid value of xyz table is displayed. As it is a multiuser system in that data can be inserted in that xyz table, if any user inserts data in the xyz table as soon as the user inserts the data the changes gets automatically reflected in main page dashboard. Just like mail systems of gmail and all.

      P Offline
      P Offline
      PiyushBha
      wrote on last edited by
      #2

      GridView Auto Refresh In this tutorial i will let you know how to auto refresh or update GridView using AJAX Timer and UpdatePanel in asp.net. In this it is described that how a GridView is update after a specific time set in timer control.

      <%@ 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 ID="ScriptManager1" runat="server">
      </asp:ScriptManager>
      <asp:UpdatePanel ID="UpdatePanel1" runat="server">
      <ContentTemplate>
      <asp:Timer ID="Timer1" Interval="10000" runat="server" ontick="Timer1_Tick">
      </asp:Timer>
      <div>
      <asp:GridView ID="GridView1" runat="server">
      </asp:GridView>
      </div>
      <asp:Label ID="update" runat="server" Text="Label"></asp:Label>
      </ContentTemplate>
      </asp:UpdatePanel>

      </form>
      

      </body>
      </html>

      using System;
      using System.Collections.Generic;
      using System.Data;
      using System.Data.SqlClient;
      using System.Configuration;
      using System.Web;
      using System.Web.UI;
      using System.Web.UI.WebControls;

      public partial class _Default : System.Web.UI.Page
      {

      protected void Page\_Load(object sender, EventArgs e)
      {
      
      }
      protected void Timer1\_Tick(object sender, EventArgs e)
      {
          databind();
          update.Text = " Gridview Was Last Updated at " + DateTime.Now;
      }
      
      public void databind()
      {
          string strcon = ConfigurationManager.ConnectionStrings\["con"\].ConnectionString;
          SqlConnection conn = new SqlConnection(strcon);
          conn.Open();
          string str = "select \* from dept";
          SqlCommand cmd = new SqlCommand(str, conn);
          SqlDataAdapter da = new SqlDataAdapter(cmd);
          DataTable dt = new DataTable();
          da.Fill(dt);
          GridView1.DataSource = dt;
          GridView1.
      
      1 Reply Last reply
      0
      • S ShindeAR

        Hello Friends, I have one query,If i use a multi-user system in that on main page there is a dashboard consider it as a grid in that grid value of xyz table is displayed. As it is a multiuser system in that data can be inserted in that xyz table, if any user inserts data in the xyz table as soon as the user inserts the data the changes gets automatically reflected in main page dashboard. Just like mail systems of gmail and all.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        This sounds like a possible application for Microsofts SignalR (very nice product, without using a timer). http://signalr.net/[^] www.styletech.co.uk

        1 Reply Last reply
        0
        • S ShindeAR

          Hello Friends, I have one query,If i use a multi-user system in that on main page there is a dashboard consider it as a grid in that grid value of xyz table is displayed. As it is a multiuser system in that data can be inserted in that xyz table, if any user inserts data in the xyz table as soon as the user inserts the data the changes gets automatically reflected in main page dashboard. Just like mail systems of gmail and all.

          A Offline
          A Offline
          Avik Ghosh22
          wrote on last edited by
          #4

          protected void Page_Load(object sender, EventArgs e)
          {
          string sss = "xxx";
          Response.AppendHeader("Refresh", "2");
          if (!IsPostBack)
          {
          // Response.Write(sss);

          //GRIDVIEW CODE

             }
          

          }

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups