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

Creating a notification from code behind (VB)

2 Answers 214 Views
Notification
This is a migrated thread and some comments may be shown as answers.
Trevor
Top achievements
Rank 1
Trevor asked on 23 May 2012, 08:30 PM
I am trying to create a RadNotification from the code behind of an .aspx page but I keep getting "Object reference not set to an instance of an object."  

I am creating a new RadNotification like so:

Dim notification As New RadNotification

and then try to show it:

notification.Show()

I understand that this notification would be empty but I have also tried giving it a title and some text but that doesn't seem to work either.

What else do I have to provide?  Is it even possible to do this?


2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 24 May 2012, 05:49 AM
Hi Trevor,

Try adding the control to the form as shown below.

VB:
Dim notification As New Telerik.Web.UI.RadNotification()
form1.Controls.Add(notification)
notification.Show()

Thanks,
Princy.
0
Trevor
Top achievements
Rank 1
answered on 24 May 2012, 06:39 PM
That did it, thanks a lot.
Tags
Notification
Asked by
Trevor
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Trevor
Top achievements
Rank 1
Share this question
or