You can find lot of examples and how to use in webpage in below link...
Ajax Go through this link.
Example For Update Panel:
You need to put your code in content template like shown in below...
<asp:UpdatePanel ID="upErrMsg" runat="server">
<ContentTemplate>
<asp:Label ID="lblErrmsg" runat="server" CssClass="ErrMsg"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
Hope this will help full to you.
Thanks
Naveen