Hi,
I'm trying to show a notification when starting a time consuming function.
But no notification will popup.
What am I doing wrong:
Code to show the notification:
Thanks and best regards,
Egbert
I'm trying to show a notification when starting a time consuming function.
But no notification will popup.
What am I doing wrong:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ReportsGeneral.ascx.cs" Inherits="ReportsGeneral" %><%@ Register TagPrefix="uc" TagName="InfoPanel" Src="~/InfoPanel.ascx" %><%@ Register TagPrefix="uc" TagName="RisWindow" Src="~/RisWindow.ascx" %><telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> <script type="text/javascript"> function OnClientFilesUploaded(sender, args) { $find('<%=RadAjaxManager1.ClientID %>').ajaxRequest(); } </script></telerik:RadScriptBlock><telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnablePageHeadUpdate="false"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadAsyncUploadReport" /> <telerik:AjaxUpdatedControl ControlID="RadGridReports" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings></telerik:RadAjaxManager><div style="margin: 15px;"> <center> <table> <tr> <td valign="top"> Begin <telerik:RadCalendar ID="RadCalendar1" runat="server"> </telerik:RadCalendar> </td> <td rowspan="2" valign="top" style="margin-left: 10px; padding-left: 10px;"> Rapporten <telerik:RadGrid ID="RadGridReports" runat="server" AllowPaging="True" ActiveItemStyle-Wrap="True" ShowStatusBar="true" AllowSorting="True" AllowMultiRowEdit="true" AutoGenerateColumns="false" AllowAutomaticInserts="true" OnNeedDataSource="RadGridReports_NeedDataSource" ClientSettings-Selecting-AllowRowSelect="true" ClientSettings-EnablePostBackOnRowClick="true" OnItemCommand="RadGridReports_ItemCommand"> <MasterTableView PageSize="10" NoMasterRecordsText="No data"> <Columns> <telerik:GridBoundColumn DataField="report_id" HeaderText="ID" UniqueName="id" Display="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="owner" HeaderText="Eigenaar" UniqueName="owner"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="filename" HeaderText="Rapport" UniqueName="filename"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="info" HeaderText="Info" UniqueName="info" Display="false"> </telerik:GridBoundColumn> </Columns> </MasterTableView> <ClientSettings EnableRowHoverStyle="true"> </ClientSettings> </telerik:RadGrid> <br /> <asp:Panel runat="server" GroupingText="Upload rapport"> <telerik:RadAsyncUpload ID="RadAsyncUploadReport" runat="server" OnFileUploaded="RadAsyncUploadReport_FileUploaded" OnClientFilesUploaded="OnClientFilesUploaded" AllowedFileExtensions="xlsx" Localization-Select="Selecteer" Width="99%"> </telerik:RadAsyncUpload> <br /> <uc:InfoPanel ID="InfoPanel1" runat="server" Type="note" Text="Je kan alleen rapporten uploaden met de .xlsx extensie!" HeaderText="Let op!"/> </asp:Panel> <br /> <div style="text-align: center"> <telerik:RadButton ID="buttonGenerateReport" runat="server" Text="Genereer rapport!" OnClick="buttonGenerateReport_Click" Skin="MetroTouch"></telerik:RadButton> </div> </td> </tr> <tr> <td valign="top"> Eind <telerik:RadCalendar ID="RadCalendar2" runat="server"> </telerik:RadCalendar> </td> <td> </td> </tr> </table> <uc:RisWindow runat="server" ID="windowWarning" /> <telerik:RadNotification ID="RadNotification" runat="server" Text="Initial text" Position="Center" AutoCloseDelay="0" Width="350" Title="Current time" EnableRoundedCorners="true" /> </center></div>Code to show the notification:
protected void buttonGenerateReport_Click(object sender, EventArgs e){ if (this.RadGridReports.SelectedItems.Count <= 0) { this.windowWarning.Show("Selecteer eerst een rapport!"); return; } // now start with the reporting string reportID = Session["ReportID"].ToString(); string ownerID = dbReports.GetReportItem(reportID, "user_id"); string reportFileName = dbReports.GetReportItem(reportID, "filename"); string shortNameOwner = dbUser.GetUserItem(ownerID, "short_name"); string completePath = Global.ReportFolder + shortNameOwner + "-" + reportFileName; this.RadNotification.Visible = true; this.RadNotification.VisibleOnPageLoad = true; this.RadNotification.Show(); if (reportFileName.ToLower().StartsWith("vakantiekaart")) { ReportsVacation reportsVacation = new ReportsVacation(); string reportResult = reportsVacation.CreateReport(completePath, reportFileName); if (reportResult != string.Empty) { this.windowWarning.Show(reportResult); return; } } else { ReportsStandard reportsStandard = new ReportsStandard(); string reportResult = reportsStandard.CreateReport(completePath, reportFileName); } try { this.FileResponse(reportFileName, Global.ReportOutputFolder + reportFileName); } catch (Exception ex) { this.windowWarning.Show("Fout bij opslaan rapport: " + Global.ReportOutputFolder + reportFileName + "! Bestaat de folder?"); }}Thanks and best regards,
Egbert