user's work effects when notification arrives.

2 posts, 0 answers
  1. Zeeshan
    Zeeshan avatar
    1 posts
    Member since:
    May 2014

    Posted 10 May 2014 Link to this post

    Hello,

    I have implemented RadNotification control in my webproject. and on certain time interval the user gets the notification of alerts. now the problem which i am facing is that when the user is filling the webform and at that time the notification popups up the user focus lost from the form. Autocomplete stops, dropdowns closes.

    What i want is that user's work not effects when the notification arrives.

    Awaiting for your quick response.

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

    Posted 12 May 2014 in reply to Zeeshan Link to this post

    Hi Zeeshan,

    Please have a look into the sample code snippet which works fine at my end. Please provide your code if it doesn't help.

    ASPX:
    <telerik:RadAutoCompleteBox ID="RadAutoCompleteBox1" runat="server" DataSourceID="SqlDataSource1"
        DataTextField="OrderID">
    </telerik:RadAutoCompleteBox>
    <telerik:RadDropDownList ID="RadDropDownList1" runat="server" DataSourceID="SqlDataSource1"
        DataTextField="OrderID">
    </telerik:RadDropDownList>
    <telerik:RadNotification ID="RadNotification1" runat="server" LoadContentOn="TimeInterval"
        Width="300" Animation="Fade" EnableRoundedCorners="true" EnableShadow="true"
        OnClientUpdated="OnClientUpdated" Title="Received messages" OffsetX="-20" OffsetY="-20"
        TitleIcon="none" UpdateInterval="3000" AutoCloseDelay="1500" OnCallbackUpdate="OnCallbackUpdate">
        <ContentTemplate>
            <asp:Literal ID="lbl" runat="server"></asp:Literal>
        </ContentTemplate>
    </telerik:RadNotification>

    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!";
        }
    }

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

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top