how to show radajax loading panel on asp button click event

5 posts, 0 answers
  1. Manaswinee
    Manaswinee avatar
    11 posts
    Member since:
    Nov 2010

    Posted 19 Nov 2010 Link to this post

            I want to show the ajaxloadingpanel on my asp button click event. The asp button is present outside the grid.The grid is ajaxified by using radajaxmanager.Kindly help me out.

    Best Regards,
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 19 Nov 2010 Link to this post

    Hello Manaswinee,

    I hope the following links will be of help.
    Ajax / Explicit Show/Hide
    Documentation: Show and hide loading panel explicitly

  3. Manaswinee
    Manaswinee avatar
    11 posts
    Member since:
    Nov 2010

    Posted 19 Nov 2010 Link to this post

           Thanks a lot for your response.I have already gone through the sites. I did the respective changes. But on clicking the asp button I am getting ''nul" ia null or not an object error. For your info. the asp button is outside the radgrid.And the grid is getting ajaxified through radAjaxmanager.

  4. Manaswinee
    Manaswinee avatar
    11 posts
    Member since:
    Nov 2010

    Posted 19 Nov 2010 Link to this post

         Below is the code in my aspx page.

    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <telerik:radajaxmanager ID="RadAjaxMgriPur" runat="server">
    <ClientEvents OnRequestStart="onRequestStart" OnResponseEnd="ResponseEnd"/>
    <telerik:AjaxSetting AjaxControlID="RGridImportedData">
    <telerik:AjaxUpdatedControl ControlID="RGridImportedData" LoadingPanelID="RadAjaxLoadingPaneliPur"/>
    <telerik:AjaxSetting AjaxControlID="btnUpload">
    <telerik:AjaxUpdatedControl ControlID="RGridImportedData" LoadingPanelID="RadAjaxLoadingPaneliPur" />
    <telerik:radajaxloadingpanel ID="RadAjaxLoadingPaneliPur" runat="server" Skin="Forest">
    <br />
    <asp:Label ID="Label1" runat="server" Font-Names="Arial" Font-Size="Small" ForeColor="#006600">Select File to import:</asp:Label>
    <br />
    <telerik:RadUpload ID="RadUpload1" runat="server" ControlObjectsVisibility="None"
    FocusOnLoad="True" Height="27px" InputSize="50" Skin="Forest" Width="378px" InitialFileInputsCount="1"
    AllowedFileExtensions=".xls" OnFileExists="RadUpload1_FileExists">
    <asp:Label ID="labelNoResults" runat="server" Font-Names="Arial" Font-Size="Small"
    ForeColor="Red">No uploaded files yet.</asp:Label>
    <asp:Repeater ID="repeaterResults" runat="server" Visible="False">
    <div class="title">
    Uploaded files in the target folder:</div>
    <%#DataBinder.Eval(Container.DataItem, "FileName")%>
    <%#DataBinder.Eval(Container.DataItem, "ContentLength").ToString() + " bytes"%>
    <br />
    <br />
    <asp:Button ID="btnUpload" runat="server" Height="25px" Text="Upload, Validate and View"
    CssClass="ButtonStyle" OnClick="btnUpload_Click" />
    <asp:CustomValidator ID="customValidatorUpload" runat="server" Display="Dynamic"
    <span style="FONT-SIZE: 12px;">Invalid extensions.</span>
    <asp:Panel runat="server" ID="pnlMessage" ForeColor="Red">
    <%= _errorMsg%>
    <asp:Label ID="lblErrMsg" runat="server" ></asp:Label>
    <br /> 
    <telerik:RadGrid ID="RGridImportedData" runat="server" Skin="Forest" AllowPaging="True"
    OnNeedDataSource="RGridImportedData_NeedDataSource" PageSize="50"
    GridLines="None" OnItemDataBound="RGridImportedData_ItemDataBound" OnUpdateCommand="RGridImportedData_UpdateCommand"
    <mastertableview commanditemdisplay="Top" editmode="InPlace" datakeynames="OrderId"
    <PagerStyle AlwaysVisible="true"/>
    <CommandItemSettings ShowExportToExcelButton="true" />

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">

    var currentLoadingPanel = null;
    var currentUpdatedControl = null;
    function validateRadUpload1(source, arguments)
    arguments.IsValid = getRadUpload('<%# RadUpload1.ClientID %>').validateExtensions();
    function onRequestStart(sender, args)
    if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0)
    currentLoadingPanel = $find("<%= RadAjaxLoadingPaneliPur.ClientID %>");
    if (args.get_eventTarget() == "<%= btnUpload.UniqueID %>")
    currentUpdatedControl = "<%= RGridImportedData.ClientID %>";
    currentUpdatedControl = "<%= RGridImportedData.ClientID %>";
    //show the loading panel over the updated control;


    function ResponseEnd()
    //hide the loading panel and clean up the global variables
    if (currentLoadingPanel != null)
    currentUpdatedControl = null;
    currentLoadingPanel = null;

  5. Tsvetina
    Tsvetina avatar
    2481 posts

    Posted 24 Nov 2010 Link to this post

    Hi Manaswinee,

    Could you please debug your javascript and let us know which line exactly throws the javascript error? Also, I see you are implementing this functionality with an RadAjaxManager in a content page - are there any other AJAX controls on the master page and how are they used/situated?

    Best wishes,
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top