Thursday, 3 October 2013

Ajax UpdatePanel Control Example in ASP.NET using C#.NET

Hi friends, in this article I will explain about Ajax UpdatePanel Control Example in ASP.NET using C#.NET.
I already explained in the previous articles about How to turn a Textbox into a rich HTML editor using AjaxControlTookitBind,Save,Edit,Update,Cancel,Delete,Paging example in GridView in ASP.NET using VB.NET and Validation in MVC 4 Razor with the Data Annotation Validators in “MODEL” in C#

<%@ Register TagPrefix="asp" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head runat="server">
    <title>Ajax UpdatePanel Control Example in ASP.NET</title>
    <form id="form1" runat="server">
        <asp:TextBox ID="txtDate" runat="server"></asp:TextBox>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
      <ContentTemplate >
                <asp:Label ID="DisplayDateTime" runat="server" Text="Panel created."></asp:Label><br />
                <asp:Button ID="btnDisplay" runat="server" OnClick="btnDisplay_Click" Text="Display Current DateTime" />

In C#.NET:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class AutoComplete : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)
        txtDate.Text = DateTime.Now.ToString();
    protected void btnDisplay_Click(object sender, EventArgs e)
        txtDate.Text = DateTime.Now.ToString();
        DisplayDateTime.Text = DateTime.Now.ToString();

No comments:

Post a Comment

© 2012-2018 All Rights Reserved.
The content is copyrighted to Kishore and may not be reproduced on other websites without permission from the owner.