Call FormView - AjaxRequest after RadWindow loading

4 posts, 0 answers
  1. archimede
    archimede avatar
    103 posts
    Member since:
    Jul 2006

    Posted 12 Oct 2010 Link to this post

    Hi,
    I need to know where call  and ajaxRequest in a particolar scenario:

    When i click in ContexMenu of a RadTreeView i open a radwindow that receives some arguments from the RadTreeView .
    On the radwindow i have two hiddenfields and a radajaxpanel that contains a formview.
    I Get the args on the rad window with this javascript function

    function
    pageLoad() {txtInputIdLinea = document.getElementById('hdfIdLinea');

     

     

     

    var currentWindow = GetRadWindow();

     

    txtInputIdLinea.value = currentWindow.argument.Idlinea;}

     

     

    The datasource of the formview has hdfIdLinea as a parameter.

    The problem is that when the radwindow finish "loading" the formview didn't see the value set in hdfIdLinea, so  after setting the value i add an ajax Request like this
    $find(

     

    "<%= Panel.ClientID %>").ajaxRequest("Update panel");

    And It works, but this code run in a loop and i have this exception
    Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed.

    May you help me?. I need to force a postback of the FormView once time after the radwindow is loaded.
    thanks._

     

  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 15 Oct 2010 Link to this post

    Hi,

    I would suggest you to use the ajaxRequestWithTarget function. By using it you could directly set target control for the Ajax request. Note that the target control is the control which should raise postback event and you should always use the control's UniqueID. Please refer to the following help topic which elaborates on this matter.




    Regards,
    Maria Ilieva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. archimede
    archimede avatar
    103 posts
    Member since:
    Jul 2006

    Posted 19 Oct 2010 Link to this post

    Hi Maria,
    The problem is that the formview is on a RadWindow so when i receive the args it's too late because de formview didnt' see the info that i put in ('hdfIdLinea')  so the databind it's done with a value of '0' , so if i do a postback the formview has the right information.
    The problem is where i can do this post back to execute it ONLY ONE TIME and when the page is loaded,
     I try on the javascript  of the radwindow but it gone in a loop.

     

     

     

    function pageLoad() {
         
         
        txtInputIdLinea = document.getElementById('hdfIdLinea');             
        var currentWindow = GetRadWindow();
        txtInputIdLinea.value = currentWindow.argument.Idlinea;
        var ajaxManager = $find("<%= RadAjaxManagerLinee.ClientID %>");
        ajaxManager.ajaxRequestWithTarget('<%= frvLinea.UniqueID %>', '');
                    
    }
    <telerik:RadAjaxManager ID="RadAjaxManagerLinee" runat="server">
           <AjaxSettings>
               <telerik:AjaxSetting AjaxControlID="hdfIdLinea">
                   <UpdatedControls>
                       <telerik:AjaxUpdatedControl ControlID="frvLinea" />
                   </UpdatedControls>
               </telerik:AjaxSetting>
           </AjaxSettings>
       </telerik:RadAjaxManager>
          
        <asp:FormView ID="frvLinea"  runat="server" DataSourceID="ODSLinee" >
          
            <EditItemTemplate>

    Thanks !!
  5. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 25 Oct 2010 Link to this post

    Hello,

    Thank you for getting back to us.

    Could you please open a regular support ticket and send us sample fully runnable application which demonstrates the described issue. Thus we will be able to correctly understand your scenario and do our best to provide a proper solution.


    Greetings,
    Maria Ilieva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top