What is AJAX? Give ASP.Net code to use UpdatePanel control

Default Page ASPX File :


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="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>ASP.Net code to use UpdatePanel control</title>
</head>
<body>
<form id="form1" runat="server">
  <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>
  <div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
      <ContentTemplate> Number of refreshes:
        <asp:TextBox ID="text" runat="server" ReadOnly="true" Text="0"> 
        </asp:TextBox>
        <asp:Button Text="Increment Counter" ID="btn" runat="server" 
         onclick="btn_Click" />
      </ContentTemplate>
    </asp:UpdatePanel>
  </div>
</form>
</body>
</html>


Default CS File

using System;
using System.Collections.Generic;
using System.Linq;
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 btnRefresh_Click(object sender, EventArgs e)
    {
    	int incCount = Int32.Parse(text.Text);
        incCount++;
        text.Text = incCount.ToString();
    }
}


Related Posts Plugin for WordPress, Blogger...

Engineering material

GTU IDP/ UDP PROJECT

GTU IDP/ UDP PROJECT

Patel free software download

  © Blogger templates The Professional Template by Ourblogtemplates.com 2008

Back to TOP