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

Load XML on Client Side

3 Answers 66 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Yo
Top achievements
Rank 1
Yo asked on 03 Jan 2014, 08:11 AM
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

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 04 Jan 2014, 05:31 AM
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.
0
Yo
Top achievements
Rank 1
answered on 06 Jan 2014, 03:32 AM
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.,
0
Accepted
Princy
Top achievements
Rank 2
answered on 06 Jan 2014, 05:50 AM
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.



Tags
RibbonBar
Asked by
Yo
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Yo
Top achievements
Rank 1
Share this question
or