I am new to ajax and am using visual studio 2005 and framework 2.0. A simple example Ajax always accepts a page load event for a button click. No deployment, and all in debug mode only, will lead me to the Page_Load event. I donβt know what the problem is? I checked the values ββof UpdatePanel1.IsInPartialRendering and ScriptManager1.IsInAsyncPostBack , which are false . Here is my code
<form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" > </asp:ScriptManager> <div> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Label ID="Label1" runat="server" Text=""></asp:Label><br /> <asp:Button ID="Button1" runat="server" Text="PostBack" OnClick="Button1_Click" /> </ContentTemplate> </asp:UpdatePanel> </div>
protected void Button1_Click(object sender, EventArgs e) { Label1.Text = DateTime.Now.ToLongTimeString()+UpdatePanel1.IsInPartialRendering+ScriptManager1.IsInAsyncPostBack; }
Google and stackoverflow are not helping me yet. Therefore, any heart hearts help me ...
source share