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

RadNotification set_text() will not display message

2 Answers 476 Views
Notification
This is a migrated thread and some comments may be shown as answers.
Vanessa
Top achievements
Rank 1
Vanessa asked on 09 Jul 2012, 08:23 PM
Hi,

I am using Telerik Controls v 2011.3.1115.35 on a .net 3.5 framework.  I am trying to set the text of the Notification via javascript in this code:

var notification = $find(Notification_ClientID);
var message = "Error";
notification.set_title("Error Notification");
notification.set_text(message);
notification.show();

The title is set, the notification displays, but not the text.  I read that there was a bug in this previously, but I believe I have the latest version...can I get some help with this?

Thank you.

Vanessa

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 10 Jul 2012, 04:28 AM
Hi Vanessa,

I tried to reproduce your issue in the latest(2012, 2, 607, 40) version and is working as expected. Please try upgrading to the the latest version.Following is the code that I tried.

ASPX:
<telerik:RadNotification ID="RadNotification1" runat="server" Width="300px" ></telerik:RadNotification>
<asp:Button ID="Button1" runat="server" OnClientClick="OnClientClick(); return false;" />

JS:
<script type="text/javascript">
    function OnClientClick() {
        var notification = $find("<%= RadNotification1.ClientID %>");
        var message = "Error";
        notification.set_title("Error Notification");
        notification.set_text(message);
        notification.show();
    }
</script>

Hope this helps.

Thanks,
Princy.
0
Robert Bross
Top achievements
Rank 1
answered on 11 Oct 2012, 03:15 PM
What I found to be the issue in my case was I had a ContentTemplate defined with the notification message text set there instead of on the Text property of the RadNotification Control itself like this...

<telerik:RadNotification ID="FormMessage" Width="300px" Height="100px" runat="server" ...>
<ContentTemplate>
Test Form Message
</ContentTemplate>
</telerik:RadNotification>

With this setup, the notification message would never get updated when using the set_text property from JS. Removing the ContentTemplate and assigning the "Test Form Message" to the Text Property of the control resolves the issue and the set_text method now works as expected.
Tags
Notification
Asked by
Vanessa
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Robert Bross
Top achievements
Rank 1
Share this question
or