Hi,
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="VB.WebForm1" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title></title><script src="Scripts/jquery-2.0.0.js"></script><script> $(function () { Sys.Application.add_load(function () { alert("Sys loaded"); }); Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(function () { alert("PageRequestManager loaded"); }); });</script></head><body><form id="form1" runat="server"><div><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><asp:Button ID="Button1" runat="server" Text="Inner Button1" /></ContentTemplate></asp:UpdatePanel><asp:UpdatePanel ID="UpdatePanel2" runat="server"><ContentTemplate><asp:Button ID="Button2" runat="server" Text="Inner Button2" /></ContentTemplate></asp:UpdatePanel></div><asp:Button ID="Button3" runat="server" Text="Whole Page" /></form></body></html>
Question:
1)Why "Sys.Application.add_load" is raised every time when I refresh the whole page or click Button3? Since this is a Client page, I thought it wouldn't raise the event by poping up an alert dialog ONLY when click the button in the UpdatePanel and for ONLY ONCE!
2)If I remove the block:
$(function () {……});
These events WON'T get raised, why?
aspx page doesn't recognize "Sys……“???