Load XML on Client Side

4 posts, 1 answers
  1. Yo
    Yo avatar
    13 posts
    Member since:
    Aug 2013

    Posted 03 Jan 2014 Link to this post

    Hi,
        Is it possible to load/re-load XML on Client Side? 
    or how to trigger the server side Load XML function by using javascript ?

    Thank you for your answer.

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

    Posted 03 Jan 2014 Link to this post

    Hi,

    Please try the following code snippet to trigger the server side Load XML function by using JavaScript.

    ASPX:
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1"
        OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadRibbonBar1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Web20">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadRibbonBar ID="RadRibbonBar1" runat="server">
    </telerik:RadRibbonBar>
    <telerik:RadButton ID="RadButton1" runat="server" Text="GetXml" OnClientClicking="OnClientClicking1">
    </telerik:RadButton>

    JavaScript:
    <script type="text/javascript">
        function OnClientClicking1(sender, args) {
            var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
            ajaxManager.ajaxRequest();
            args.set_cancel(true);
        }
    </script>

    C#:
    protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
    {
        GetSelecteValue();
            
    }
    public void GetSelecteValue()
    {
        RadRibbonBar1.LoadContentFile("RibbonBar.xml");
    }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Yo
    Yo avatar
    13 posts
    Member since:
    Aug 2013

    Posted 05 Jan 2014 Link to this post

    Hi, 
       Thanks for your answer, I have tried your code but got the below error. 
    Do u have any idea what's the problem may be?

    Thanks a lot.

    Don.,
  5. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 05 Jan 2014 Link to this post

    Hi,

    Please have a look into this help documentation which discuss about the same error. Also please go through the following forum thread which discuss the same issue.

    The Controls collection cannot be modified.
    The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

    Hope this will helps you.
    Thanks,
    Princy.



Back to Top