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. ajax for partial refresh of the page

ajax for partial refresh of the page

Scheduled Pinned Locked Moved ASP.NET
csharphelphtmllinqdesign
3 Posts 2 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.
  • K Offline
    K Offline
    KishoreT
    wrote on last edited by
    #1

    I am using ajax scriptmanager to update system time on the webpage. the corresponding code was placed in ContentTemplate. The text out side the contentTemplate also refreshing instead of partial refresh of the page. pls help me. code: aspx ------------ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Ajax.aspx.cs" Inherits="WebApplication1.Ajax" %> <!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>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:Label ID="Label2" runat="server" Text="My System time:"></asp:Label> <asp:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server"></asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> </ContentTemplate> </asp:UpdatePanel> <asp:Timer ID="Timer1" runat="server" Interval="500" ontick="Timer1_Tick" /> </div> </form> </body> </html> //server side code using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; namespace WebApplication1 { public partial class Ajax : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if(!IsPostBack) Label1.Text = System.DateTime.Now.ToString(); } protected void Button1_Click(object sender, EventArgs e) { Label1.Text = System.DateTime.Now.ToString(); } protected void Timer1_Tick(object sender, EventArgs e) { Label1.Text = System.DateTime.Now.ToString(); } } } Pls help to resolve this problem

    K 1 Reply Last reply
    0
    • K KishoreT

      I am using ajax scriptmanager to update system time on the webpage. the corresponding code was placed in ContentTemplate. The text out side the contentTemplate also refreshing instead of partial refresh of the page. pls help me. code: aspx ------------ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Ajax.aspx.cs" Inherits="WebApplication1.Ajax" %> <!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>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:Label ID="Label2" runat="server" Text="My System time:"></asp:Label> <asp:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server"></asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> </ContentTemplate> </asp:UpdatePanel> <asp:Timer ID="Timer1" runat="server" Interval="500" ontick="Timer1_Tick" /> </div> </form> </body> </html> //server side code using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; namespace WebApplication1 { public partial class Ajax : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if(!IsPostBack) Label1.Text = System.DateTime.Now.ToString(); } protected void Button1_Click(object sender, EventArgs e) { Label1.Text = System.DateTime.Now.ToString(); } protected void Timer1_Tick(object sender, EventArgs e) { Label1.Text = System.DateTime.Now.ToString(); } } } Pls help to resolve this problem

      K Offline
      K Offline
      KingHau
      wrote on last edited by
      #2

      The easiest way is move your timer control into

      Make it better.

      K 1 Reply Last reply
      0
      • K KingHau

        The easiest way is move your timer control into

        Make it better.

        K Offline
        K Offline
        KishoreT
        wrote on last edited by
        #3

        hey thank u its working!

        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