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

Can't set notification properties on master notification?

2 Answers 109 Views
Notification
This is a migrated thread and some comments may be shown as answers.
Software
Top achievements
Rank 1
Software asked on 15 May 2012, 09:35 PM
I'm using a RadNotification in a UserControl, which is in a content page, which is in a master page.  The RadNotification the UserControl is referencing is in the Master page.  Here's the code I use to get it:
public RadNotification GetNotificationAlert(Control ctl)
{
    var master = (defaultMaster)ctl.Page.Master;
    if (master != null)
        return master.FindControl("RadNotification1") as RadNotification;
 
    return null;
}

This works, but if I try to change any of the properties of the notification, such as width, visibletitlebar, etc. nonw of them work.  Here's an example:
var notification = GetNotificationAlert(this);
notification.VisibleTitlebar = false;
notification.Width = 540;
notification.Height = 90;
notification.Opacity = 70;

Any idea what I might be doing wrong?

Thanks!

2 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 17 May 2012, 03:34 PM
Hi Eddie,

In what event are you calling this code? Is it executed during an AJAX request that does not involve the RadNotification? This can be the case if, for example, your entire user control is wrapped in an update panel/ajax setting from the parent page. You can confirm if this is the case by examining the network requests and responses, e.g. via Firebug. What can be done in this case - wrap the notification in an update panel so that it will be disposed and updated on the client. If this panel's UpdateMode is set to Conditional you will need to also call its Update() method each time you modify the notification. If it is set to Always (the default) keep in mind that each AJAX request will dispose this notification which may not be desired.


Greetings,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Software
Top achievements
Rank 1
answered on 18 May 2012, 04:47 PM
I wrapped the Notification in an update panel and set the updatemode to conditional, and that causes the notification to update each time it is called, which fixes my issue.  Thanks!
Tags
Notification
Asked by
Software
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Software
Top achievements
Rank 1
Share this question
or