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

Control is ajaxified without calling the OnRequestStart

1 Answer 81 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 20 Aug 2008, 06:47 AM
Hello!

In my Test - ASPX file, there is a control which seems to be ajaxified, but i didn't make the settings for this.

I have two asp:DropDownLists inside of a asp:Panel(TestPanel).
Outside of this Panel there exists a hidden button which will never raise an event(it is also hidden).

This button is ajaxified an updates the panel below.

In code-behind in the OnSelectedIndexChange of the first combobox, the second combobox is set to the same "SelectedIndex".

When I start the website and change now the first dropdownlist, the value of the second one changes also on the website. But there is no Ajax - Setting which enforces this behaviour. Why is the second one updated?
It seems to me, if a postback is called out of an "UpdatedControl", that the whole control is updated, regardless to which control calls the postback.

I also noticed, that there is NO postback, which refreshes the whole site. The post which is sent seems to be an ajax request(small amount of time for the request, no refreshing of the whole page is noticeable), but the ClientEvent
"OnRequestStart" is never called. So how can it be, that it seems to be an ajax request without calling the client events?

Here my aspx file:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AjaxTest.aspx.cs" Inherits="TestWebPerformance.TestUsercontrol.AjaxTest" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %> 
 
 
<!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>Ajax test</title> 
</head> 
<body style="background-color: Gray;">  
    <form id="form1" runat="server">  
        <asp:ScriptManager ID="ScriptManager1" runat="server">  
        </asp:ScriptManager> 
 
        <telerik:RadAjaxManager ID="ajaxManager" runat="server">  
            <ClientEvents OnRequestStart="alert('now')" /> 
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="btnTabTrigger">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="TestPanel" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
          
        <div style="display: none;">  
            <asp:Button ID="btnTabTrigger" OnClick="RadTabStrip_Triggered" runat="server" /> 
        </div> 
          
        <asp:Panel ID="TestPanel" runat="server">  
            <asp:DropDownList ID="test" AutoPostBack="true" OnSelectedIndexChanged="test_OnSelectedIndexChanged" runat="server">  
            </asp:DropDownList> 
          
            <asp:DropDownList ID="cbo3" runat="server">  
            </asp:DropDownList> 
        </asp:Panel> 
 
    </form> 
</body> 
</html> 
 

and here my code behind:
using System;  
using System.Collections;  
using System.Configuration;  
using System.Data;  
using System.Linq;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.HtmlControls;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Xml.Linq;  
 
namespace TestWebPerformance.TestUsercontrol  
{  
    public partial class AjaxTest : System.Web.UI.Page  
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {  
            if (!Page.IsPostBack)  
            {  
                test.Items.Add(new ListItem("t1", "0"));  
                test.Items.Add(new ListItem("t2", "1"));  
                test.Items.Add(new ListItem("t3", "2"));  
                cbo3.Items.Add(new ListItem("main1", "0"));  
                cbo3.Items.Add(new ListItem("main2", "1"));  
                cbo3.Items.Add(new ListItem("main3", "2"));  
            }  
        }  
 
 
        protected void test_OnSelectedIndexChanged(object sender, EventArgs e)  
        {  
            cbo3.SelectedIndex = test.SelectedIndex;  
        }  
    }  
}  
 

Thank you very much!

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 20 Aug 2008, 11:16 AM
Hello Michael,

Please refer to

http://www.telerik.com/community/forums/thread/b311D-bkgkgd.aspx

Greetings,
Dimo
the Telerik team

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