Microsoft AJAX Sample

   

   code behind page   
   
   Partial Public Class _Default
      Inherits System.Web.UI.Page
   
      Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
         If ScriptManager1.IsInAsyncPostBack Then
            Label1.Text = Textbox1.Text
         Else
            Label1.Text = "Not AJAX"
         End If
      End Sub
   
   End Class
   

 


 
 

   aspx frontpage   
 
   <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="WebApplication1._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 id="Head1" runat="server">
   <title>Untitled Page</title>
   </head>
   
   <body>
 
      <form id="form1" runat="server">
      <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
 
      <div>
 
      <asp:UpdatePanel ID="UpdatePanel1" runat="server">
         <ContentTemplate>
            <asp:Textbox ID="Textbox1" runat="server" Text=""></asp:Textbox>
            <asp:Button ID="Button1" runat="server" Text="Submit"/>
            <BR>
            <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
         </ContentTemplate>
      </asp:UpdatePanel>
  
      </div>
 
      </form>
    
   </body>
   </html>