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

Multiple RadNotifications on a page

1 Answer 123 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dimitrios
Top achievements
Rank 1
Dimitrios asked on 07 Oct 2014, 09:10 AM
Hello all..

I have the following peculiar problem.

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

<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">
</telerik:RadNotification>

vb
  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!"
      n1.Show()
      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!"
      n1.Show() 
        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...




1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 07 Oct 2014, 10:18 AM

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.


Regards,

Marin Bratanov
Telerik
 

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.

 
Tags
General Discussions
Asked by
Dimitrios
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or