Multiple RadNotifications on a page

2 posts, 0 answers
  1. Dimitrios
    Dimitrios avatar
    45 posts
    Member since:
    Jun 2014

    Posted 07 Oct 2014 Link to this post

    Hello all..

    I have the following peculiar problem.

    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">

    <telerik:RadNotification ID="n1" runat="server" Text="" Position="Center"
        AutoCloseDelay="5000" Width="450" Title="" KeepOnMouseOver="true"
        EnableRoundedCorners="true" Animation="Resize" ContentIcon="warning"
        AnimationDuration="700" TitleIcon="none" Font-Size="12px" Font-Bold="True"
        ShowCloseButton ="true">

      Protected Sub grdTenders_DeleteCommand(sender As Object, e As GridCommandEventArgs)

         ... code to set the value of <res> below

        If res = 1 Then
          n1.Title = "Error Deleting"
          n1.Text = "Cannot delete this tender. It has been sent out to at least 1 Manufacturer!"
          Exit Sub
        End If

    ...and further down

    Protected Sub grdTenDetails_ItemCommand(sender As Object, e As GridCommandEventArgs)

         ... again code to set the value of res below

        If res = 1 Then
          n1.Title = "Error Editing"
          n1.Text = "Cannot Edit this tender. It has been sent out to at least 1 Manufacturer!"
            e.Canceled = True
            Exit Sub
          End If

    The first notification works fine.
    The second time the notification should be shown (on the second sub) the window pops up without title or text!
    It is functional, but the values for <title> and <text> remain the default ones (empty)
    I stopped the code in n1.Show() and the values are correct. Then I continue the code and still no text/title.

    I even tried to add another notification (r2) on the page and changed the code on the second sub, but still the second window comes up empty!

    Any information would be appreciated...

  2. Marin Bratanov
    Marin Bratanov avatar
    3899 posts

    Posted 07 Oct 2014 Link to this post

    Hello Dimitrios,

    The most likely reason for such a problem is that AJAX is used and the notification does not participate in the partial rendering in all cases it needs to. Most likely, you have an AJAX setting where grdTenders is an initiator and n1 is an UpdatedControl, so you would need a similar setting where grdTenDetails is the initiator and n1 is updated.

    An alternative is to remove the n1 control from such AJAX settings and wrap it in an asp:UpdatePanel with UpdateMode=Conditional. Thus, you can call the update panel's Update() server method when you need to show the notification and be sure that it will travel to the client.


    Marin Bratanov

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top