Displaying a Sitefinity Page as a RadWindow
I would like to be able to create and publish a Sitefinity Page that behaves as a RadWindow when clicked upon in the Site Navigation. http://demos.telerik.com/aspnet-ajax/window/examples/default/defaultcs.aspx
Is there a way to set properties within the Sitefinity page so that I can configure my page to display as a RadWindow?
Hello Samir,
You need to create a custom navigation control for the purpose. Here is the complete code of such control. I used RadPanelBar as navigation, but you can use other navigation control.
The .ascx file
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WindowNavigation.ascx.cs" Inherits="SitefinityWebApp.Custom.WindowNavigation" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<
asp:SiteMapDataSource
ID
=
"SiteMapDataSource1"
runat
=
"server"
/>
<
asp:ScriptManager
ID
=
"Scriptmanager1"
runat
=
"server"
/>
<
telerik:RadWindowManager
runat
=
"server"
ID
=
"RadWindowManager1"
></
telerik:RadWindowManager
>
<
telerik:RadPanelBar
ID
=
"RadPanelBar1"
runat
=
"server"
DataSourceID
=
"SiteMapDataSource1"
OnClientItemClicking
=
"OnClientItemClicking"
OnItemClick
=
"OnItemClick"
>
</
telerik:RadPanelBar
>
<
script
type
=
"text/javascript"
>
function OnClientItemClicking(sender, args)
var theValue = args.get_item().get_value();
if (theValue == "page5")//enter the name of the page that you want to be clicked and opened as Window
args.set_cancel(true); //cancel the postback( this preserves the RadWindow on page
radopen("http://www.telerik.com", "RadWindow1"); //open a RadWindow, you may call your function here instead
</
script
>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
namespace SitefinityWebApp.Custom
public partial class WindowNavigation : System.Web.UI.UserControl
protected void Page_Load(object sender, EventArgs e)
protected void OnItemClick(object sender, Telerik.Web.UI.RadPanelBarEventArgs e)
Response.Write("item clicked on: " + DateTime.Now.ToString() + "<
br
/>The item's text was: " + e.Item.Text);
I would like to be able to display a modal Help window from within an existing Sitefinity page. Is there a way to utilize either the Window or Window Manager controls from the Sitefinity RadControls toolbox to achieve this functionality?
Hi Samir,
This can be done in many was depending on how you need the radopen function to work. You can create a custom widget with rad window that will open certain content. The approach is similar to the code I sent in my previous post. For more application scenarios refer to the demos.
Kind regards,
Stanislav Velikov
the Telerik team