UserControl And JaxManager

5 posts, 0 answers
  1. peyman naji
    peyman naji avatar
    11 posts
    Member since:
    Nov 2009

    Posted 08 Dec 2009 Link to this post

    Hi friends ,

     I Have one page (Index.aspx) , and put one ajaxmanager  in this page …   I use ajaxmanager  for handle 2 clientside event  1- OnrequestStart  2- OnResponseEnd   .

    Also I have one UserControl  in Index.aspx … in this UC  I have 2 Button and when I click one of them , I want to fire OnRequestStart  and get element (get_eventTargetElement) that make ajax request in UC  …

    How can I do it ?!

    Plz help me 

     

    Thank u very much .

    Regards,

    peyman

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 08 Dec 2009 Link to this post

    Hello Peyman,

    You can handle the master manager events in the user control by attaching event handlers to the manager as follows:
    ascx:
    <telerik:RadAjaxManagerProxy ID="RadAjaxManager1" runat="server" > 
         <AjaxSettings> 
             <telerik:AjaxSetting AjaxControlID="Button1"
                 <UpdatedControls> 
                     <telerik:AjaxUpdatedControl  ... /> 
                 </UpdatedControls> 
             </telerik:AjaxSetting> 
         </AjaxSettings> 
     </telerik:RadAjaxManagerProxy> 

    ascx.cs(WebUserControl codebehind):
    protected void Page_Load(object sender, EventArgs e) 
       RadAjaxManager manager = RadAjaxManager.GetCurrent(Page); 
       manager.ClientEvents.OnRequestStart = "onRequestStart"
       

    Index.aspx:
    function onRequestStart(sender, eventArgs)  
      {       
        var button = eventArgs.get_eventTargetElement();  
      }  

    Thanks
    Princy.
  3. peyman naji
    peyman naji avatar
    11 posts
    Member since:
    Nov 2009

    Posted 08 Dec 2009 Link to this post

    Hi Princy ,
    Thank u so much , Thats very helpful ,

    Regards,
    peyman
  4. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 09 Dec 2009 Link to this post

    Hi Peyman,

    I'm glad i could help you out. You could also go through the following help document for better understanding:
    AJAX Manager Proxy

    Regards
    Princy.
  5. peyman naji
    peyman naji avatar
    11 posts
    Member since:
    Nov 2009

    Posted 11 Dec 2009 Link to this post

    Hi Princy ,
    Thank u very much . Thats also very helpful .

    Regards ,
    peyman
Back to Top