Bookmark and Share
Showing posts with label RadNotification. Show all posts
Showing posts with label RadNotification. Show all posts

Wednesday, May 09, 2012

How to show RadNotification inside an IFRAME

The Telerik RadNotification is a great component, you can show beautiful notifications on the web using little code.

There’s a  problem, if you host your aspx page inside an IFRAME the RadNotification element is positioned without considering the scrolling of the parent window.

The solution uses the RadNotification OnClientShown event

Server side:

RadNotification1.OnClientShown = "ShowNotification";





Client Side:




function ShowNotification(sender, eventArgs) 
{
//check if the page is inside a frame
if (window.location != window.parent.location)
{
if (sender.get_popupElement()!=null)
{
var leftPos = $(sender.get_popupElement()).position().left;
sender.moveTo(leftPos, window.parent.window.scrollY);
}
}
}





That’s all, hope it helps