I have a custom silverlight control that is placed inside the ContentTemplate of the RadNotification control. I am having problems finding this custom silverlight control within Javascript so that I can pass values to the silverlight control through a scriptable member. Basically, what I am trying to do is use the RadNotification control to check for any changes in value using the UpdateInterval and OnCallbackUpdate members. The OnCallbackUpdate sets static variables on the server side that is used by javascript to pass to the silverlight control. If the values have changed then the Nofication control is told to show, if the values are the same then the control remains hidden. I have everything working except being able to find my silverlight control embeded within the RadNotification contentTemplate so that I can reference the object in my javascript and call my silverlight scriptable member.
RadNotification Declaration:
OnCallbackUpdate
Javascript
RadNotification Declaration:
<
telerik:RadNotification
ID
=
"RadNotification1"
runat
=
"server"
Width
=
"380"
Height
=
"100"
Animation
=
"Fade"
EnableRoundedCorners
=
"true"
VisibleTitlebar
=
"false"
OnClientUpdated
=
"showNotification"
OffsetY
=
"-400"
OffsetX
=
"-500"
Value
=
"false"
AutoCloseDelay
=
"3000"
UpdateInterval
=
"6000"
LoadContentOn
=
"TimeInterval"
OnCallbackUpdate
=
"resetNotification"
>
<
ContentTemplate
>
<
object
id
=
"silver2"
data
=
"data:application/x-silverlight-2,"
type
=
"application/x-silverlight-2"
width
=
"380"
height
=
"100"
>
<
param
name
=
"source"
value
=
"../ClientBin/Notification.xap"
/>
<
param
name
=
"onError"
value
=
"onSilverlightError"
/>
<
param
name
=
"background"
value
=
"Transparent"
/>
<
param
name
=
"windowless"
value
=
"true"
/>
<
param
name
=
"pluginbackground"
value
=
"Transparent"
/>
<
param
name
=
"minRuntimeVersion"
value
=
"4.0.50826.0"
/>
<
param
name
=
"autoUpgrade"
value
=
"true"
/>
<
a
href
=
"http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50826.0"
style
=
"text-decoration:none"
>
<
img
src
=
"http://go.microsoft.com/fwlink/?LinkId=161376"
alt
=
"Get Microsoft Silverlight"
style
=
"border-style:none"
/>
</
a
>
</
object
>
</
ContentTemplate
>
</
telerik:RadNotification
>
OnCallbackUpdate
protected
void
resetNotification(
object
sender, RadNotificationEventArgs e)
{
RadNotification1.Value =
"false"
;
if
(Queue.Count>0)
{
var s = Queue.Dequeue();
value 1 = s.Value1;
value 2 = s.value2;
value3 = s.value3;
RadNotification1.Value =
"true"
;
}
}
Javascript
function
showNotification(sender, args) {
var
showMsg = sender.get_value()
if
(showMsg ==
"true"
) {
sender.show();
var
silverlightplugin = $get(
"silver2"
);
var
content = silverlightplugin.content;
content.MainPage.BindValues(value1,value2,value3);
}
}