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

RadNotification on Interval Interrupts Page

2 Answers 161 Views
Notification
This is a migrated thread and some comments may be shown as answers.
Mirek
Top achievements
Rank 1
Mirek asked on 11 Jan 2017, 01:32 AM

I have set up a fairly complex notification system that is working pretty well... except for one small problem, whenever the update interval fires(with or without a notification to display) it interrupts the user.  For example if you are typing into a text box and the update fires as you are typing, the typing either stops and then catches up in dumber controls, or is lost all together in controls like the RadEditor.  In other words it is not firing asynchronously, it seems to freeze the browser as it calls the NotificationUpdate (server side) method.  I have ajax timers in other places that don't seem to have this behavior and thought this should behave the same way.

 

The Notification is in the Master page (see control below), I have tried registering it in various ways with the Script/Ajax manager however it does not seem to make a difference... but I feel like maybe I am missing something there?  What is the correct way to set this up so that it does not interrupt page load?

 

I think I amdoing the same thing as the demo here: http://demos.telerik.com/aspnet-ajax/notification/examples/updateinterval/defaultcs.aspx

except I can't really tell if it has the same behavior as there is nothing to type into there, and I am also doing more on the server side that would be taking longer.

 

<telerik:RadNotification ID="rnNotice" ShowCloseButton="false" runat="server" Skin="Black" LoadContentOn="TimeInterval" EnableRoundedCorners="true" EnableShadow="true" OnCallbackUpdate="NotificationUpdate" UpdateInterval="3500" Title="Notification" onclientupdated="OnClientUpdated" Font-Strikeout="False" Opacity="95"  AutoCloseDelay="0" TitleIcon="App_Themes/Blue/Images/bell.png">
      <ContentTemplate >
          
        <div class="NoticeBody"><asp:Literal ID="lMessage" runat="server"></asp:Literal></div>
          <telerik:RadButton ID="rbDismiss" runat="server" Text="Dismiss" OnClick="rbDismiss_Click" SingleClick="true" SingleClickText="Dismissing Notice(s)...">
              <Icon PrimaryIconCssClass="rbRemove" />
          </telerik:RadButton>
      
    </ContentTemplate>
</telerik:RadNotification>

2 Answers, 1 is accepted

Sort by
0
Mirek
Top achievements
Rank 1
answered on 12 Jan 2017, 07:55 PM

I found this behavior occurs when you put a RadButton into the control... a regular asp button/link button do not cause this.  Seems like this is a bug as I would expect it to work the same.

Now I need an alternate method to indicate to the user that the button has been clicked as I can't use the SingleClick feature...

0
Ianko
Telerik team
answered on 16 Jan 2017, 06:59 AM

Hello Mirek,

I tested with the code below, but to no avail. The focus stays in RadEditor and RadNotification is being updated properly.

<telerik:RadEditor runat="server"></telerik:RadEditor>
 
<telerik:RadNotification ID="rnNotice"
    ShowCloseButton="false"
    runat="server" Skin="Black"
    LoadContentOn="TimeInterval"
    EnableRoundedCorners="true"
    EnableShadow="true"
    OnCallbackUpdate="rnNotice_CallbackUpdate"
    UpdateInterval="3500" Title="Notification"
    OnClientUpdated="OnClientUpdated"
    Font-Strikeout="False" Opacity="95"
    AutoCloseDelay="0" TitleIcon="App_Themes/Blue/Images/bell.png">
    <ContentTemplate>
 
        <div class="NoticeBody">
            <asp:Literal ID="lMessage" runat="server"></asp:Literal></div>
        <telerik:RadButton ID="rbDismiss" runat="server" Text="Dismiss" SingleClick="true" SingleClickText="Dismissing Notice(s)...">
            <Icon PrimaryIconCssClass="rbRemove" />
        </telerik:RadButton>
 
    </ContentTemplate>
</telerik:RadNotification>
 
<script type="text/javascript">
function OnClientUpdated(sender, args) {
    var message = "Update (check) was done!";
    var newMsgs = sender.get_value();
    if (newMsgs != 0) {
        sender.show();
        message += (newMsgs == 1) ? (" There is 1 new message!") : (" There are " + newMsgs + " new messages!");
    } else {
        message += " There are no new messages!";
    }
}
</script>

protected void rnNotice_CallbackUpdate(object sender, RadNotificationEventArgs e)
{
    int newMsgs = DateTime.Now.Second % 10;
    if (newMsgs == 5 || newMsgs == 7 || newMsgs == 8 || newMsgs == 9) newMsgs = 0;
    lMessage.Text = String.Concat(new object[] { "You have ", newMsgs, " new messages!" });
    rnNotice.Value = newMsgs.ToString();
}

 

Regards,
Ianko
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Notification
Asked by
Mirek
Top achievements
Rank 1
Answers by
Mirek
Top achievements
Rank 1
Ianko
Telerik team
Share this question
or