I ran into a bit of an unexpected issue, and I am curious if there is an elegant way around it. Basically, if you add a button as an AjaxUpdatedControl, clicking on that button will now cause async postbacks, and I still want it to do a full, regular postback. Is there a way to make this happen?
Simple example with dropdownlist and button below. Click on the button, and examine the console in Firebug to verify.
Simple example with dropdownlist and button below. Click on the button, and examine the console in Firebug to verify.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> |
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> |
<!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"> |
<asp:ScriptManager ID="ScriptManager1" runat="server"> |
</asp:ScriptManager> |
<div> |
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"> |
<asp:ListItem Value="test">Test</asp:ListItem> |
<asp:ListItem>Test2</asp:ListItem> |
</asp:DropDownList> |
</div> |
<asp:Button ID="Button1" runat="server" Text="Button" /> |
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="DropDownList1"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="Button1" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</AjaxSettings> |
</telerik:RadAjaxManager> |
</form> |
</body> |
</html> |
using System; |
using System.Collections.Generic; |
using System.Linq; |
using System.Web; |
using System.Web.UI; |
using System.Web.UI.WebControls; |
public partial class _Default : System.Web.UI.Page |
{ |
protected void Page_Load(object sender, EventArgs e) |
{ |
} |
protected void Button1_Click(object sender, EventArgs e) |
{ |
string test = "test if we do a full postback"; |
} |
protected void Page_PreRender(object sender, EventArgs e) |
{ |
this.Button1.Text = this.DropDownList1.Text; |
} |
} |