This is a migrated thread and some comments may be shown as answers.

AjaxUpdatedControl making async callbacks?

1 Answer 48 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Mike Dugan
Top achievements
Rank 1
Mike Dugan asked on 01 Nov 2008, 08:20 PM
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.
<%@ 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; 
    } 
 

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 04 Nov 2008, 12:35 PM
Hi Mike,

Can you please elaborate a little bit on your setup- why do you need to perform a full page postback? Are you looking to update another control, the button itself, or is there a way in which the ajaxified control is misbehaving? This will help me better address the question at hand.

Greetings,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Ajax
Asked by
Mike Dugan
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or