I have been having a problem on my page where clicking on the button doesn't appear to cause a post-back (although stepping through the code shows that it is going through the lines of code in the code behind page.
I created a new simple project and have been able to reproduce the issue:
Default.aspx:
Code behind file:
What I expect to happen is that when the user clicks on the button with the checkbox un-checked, the lblMessage would show the text "Not checked". As noted above, stepping through the code shows that the line is executed, but it doesn't show on the page.
If I comment out or remove the following line on the aspx page and then run the project again, clicking on the button with the checkbox un-checked produces the desired result.
Any ideas as to what could be causing the problem?
I note that the Telerik Ajax Manager version is v2009.2.826.20 (as shown on the aspx page).
I created a new simple project and have been able to reproduce the issue:
Default.aspx:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> |
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="rad" %> |
<!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></title> |
</head> |
<body> |
<form id="form1" runat="server"> |
<div> |
<asp:Panel class="clientheading" ID="Panel1" runat="server" BorderWidth="0px" Visible="False"> |
<asp:Label ID="header1" runat="server" >Test</asp:Label> |
</asp:Panel> |
<rad:RadScriptManager runat="server" ID="RadScriptManager1" /> |
<rad:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
<AjaxSettings> |
<rad:AjaxSetting AjaxControlID="checkbox1"> |
<UpdatedControls> |
<rad:AjaxUpdatedControl ControlID="label1" /> |
<rad:AjaxUpdatedControl ControlID="button1" /> |
<rad:AjaxUpdatedControl ControlID="lblMessage" /> |
</UpdatedControls> |
</rad:AjaxSetting> |
</AjaxSettings> |
</rad:RadAjaxManager> |
</div> |
<asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label> |
<table id="Table1" runat="server"> |
<tr> |
<td><asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" /></td> |
</tr> |
<tr> |
<td><asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></td> |
</tr> |
</table> |
<table id="Table2" runat="server"> |
<tr> |
<td><asp:Button ID="Button1" runat="server" Text="Not checked" /></td> |
</tr> |
</table> |
</form> |
</body> |
</html> |
Code behind file:
Partial Class _Default |
Inherits System.Web.UI.Page |
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click |
If Not Me.CheckBox1.Checked Then |
Me.lblMessage.Text = "Not checked" |
Me.lblMessage.Visible = True |
Else |
Response.Redirect("page2.aspx") |
End If |
End Sub |
Protected Sub CheckBox1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged |
Me.lblMessage.Text = "" |
Me.Label1.Text = "Checked = " & Me.CheckBox1.Checked.ToString |
If Me.CheckBox1.Checked Then |
Me.Button1.Text = "Checked" |
Else |
Me.Button1.Text = "Not Checked" |
End If |
End Sub |
End Class |
What I expect to happen is that when the user clicks on the button with the checkbox un-checked, the lblMessage would show the text "Not checked". As noted above, stepping through the code shows that the line is executed, but it doesn't show on the page.
If I comment out or remove the following line on the aspx page and then run the project again, clicking on the button with the checkbox un-checked produces the desired result.
<
rad:AjaxUpdatedControl ControlID="button1" />
Any ideas as to what could be causing the problem?
I note that the Telerik Ajax Manager version is v2009.2.826.20 (as shown on the aspx page).