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

OnRequestStart for Ajax Manager and client side events call

3 Answers 99 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Rose Garza
Top achievements
Rank 1
Rose Garza asked on 30 Jul 2008, 09:17 AM
Hi,

I have a code which has a RadSplitter and with in the panels i have other controls like tool bar, html table, tree view etc. I have used RADAjaxManager which has the controlID as the RadSplitter and Update ControlID also as RadSplitter meaning when i perform any actions within RADSplitter, the entire controls within RADSplitter will get updated in Ajax. The entire stuff works fine in IE, when i click on the toolbar button, it calls the client side onclick event of the tool bar button and then moves on to OnRequestStart of the AjaxManager where i decide to proceed to server side or return false and don't execute anything further.
The issue now is when i execute the page in Firefox, the OnRequestStart is getting called first and then it moves further to the client side event of the toolbar button. So the page is not behaving the same in IE and Firefox. Any fix for this? 

3 Answers, 1 is accepted

Sort by
0
Pavel
Telerik team
answered on 04 Aug 2008, 10:32 AM
Hello Rose,

I tried to reproduce the problem described by you, but had no success. Find attached the website I created for testing. Give it a try and let me know what is different in your project or if I am missing something.

All the best,
Pavel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Rose Garza
Top achievements
Rank 1
answered on 05 Aug 2008, 11:16 AM
Hi,

I was not able to test the application, as i don't have the System.web.extension dll in machine, i tried to remove the ScriptManager and use it, but it was providing some errors. So i did not try much there.

I will attach my code, which behaves different in IE and firefox.
The code is,

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %> 
<%@ Register Assembly="RadToolbar.Net2" Namespace="Telerik.WebControls" TagPrefix="radTlb" %> 
<%@ Register Assembly="RadAjax.Net2" Namespace="Telerik.WebControls" TagPrefix="radA" %> 
<%@ Register Assembly="RadSplitter.Net2" Namespace="Telerik.WebControls" TagPrefix="radspl" %> 
 
<!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>Untitled Page</title> 
    <script language="javascript" type="text/javascript">  
        function click_more()  
        {  
            alert('click_more');  
            return false;  
        }  
          
        function Defaul_click()  
        {  
            alert('Default_click');  
            return false;  
        }  
          
        function RequestStart(sender, eventArgs)  
        {  
            alert(eventArgs.EventTarget);  
        }  
          
    </script> 
</head> 
<body> 
    <form id="form1" runat="server">  
    <div> 
    <radspl:RadSplitter ID="radSplitter" runat="server" Skin="Outlook" Width="100%" Visible="true" 
                ResizeWithParentPane="true" ResizeWithBrowserWindow="true" ResizeMode="EndPane">  
    <radspl:RadPane ID="radtvwPane" runat="server" Width="20%" Scrolling="Both" Height="100%" 
                    EnableViewState="true">  
                                    <radTlb:RadToolbar ID="tbrButtons" runat="server" UseFadeEffect="True" Skin="Mac" 
                                    SkinsDir="~/RadControls/Toolbar/Skins/" AutoPostBack="true">  
                                    <Items> 
                                        <radTlb:RadToolbarButton ID="rbtnMore" DisplayType="TextImage" CommandName="More" 
                                            ButtonImage="row_add.png" Hidden="False" runat="server" Style="font-weight: normal;  
                                            font-family: Tahoma" ButtonText="Add" ToolTip="Add row" onClick="return Defaul_click();"/>  
                                            </Items> 
                                            </radTlb:RadToolbar> 
        <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="if(!Defaul_click()){return false;}" /> 
        </radspl:RadPane>     
        </radspl:RadSplitter> 
          
            <radA:RadAjaxManager ID="ajaxPnlResults" runat="server">  
            <AjaxSettings> 
                <radA:AjaxSetting AjaxControlID="radSplitter">  
                    <UpdatedControls> 
                        <radA:AjaxUpdatedControl ControlID="radSplitter"></radA:AjaxUpdatedControl> 
                    </UpdatedControls> 
                </radA:AjaxSetting>                 
            </AjaxSettings> 
            <ClientEvents OnRequestStart="RequestStart"/>  
        </radA:RadAjaxManager>            
    </div> 
    </form> 
</body> 
</html> 
 

and the code behind is,

using System;  
using System.Data;  
using System.Configuration;  
using System.Collections;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Web.UI.HtmlControls;  
 
public partial class Default2 : System.Web.UI.Page  
{  
    protected void Page_Load(object sender, EventArgs e)  
    {  
 
        //Telerik.WebControls.RadToolbarButton tbBtnMore =  
        //   tbrButtons.Items.GetButtonByCommandName("More");  
        //tbBtnMore.Attributes.Add("onClick", "if(!click_more()){return false;}");  
    }  
}  
 

Please check the above code and provide me a solution.
Thanks.
0
Pavel
Telerik team
answered on 08 Aug 2008, 08:17 AM
Hello Rose,

Indeed you are right and the problem exists with the classic version of the controls. It seems the issue is related to the RadToolbar. However it is not present with the Asp.Net Ajax version of the controls. We recommend you to migrate to this new suite, which offers better performance and more features.

Sincerely yours,
Pavel
the Telerik team

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