Displaying a Sitefinity Page as a RadWindow

Posted by Community Admin on 04-Aug-2018 15:42

Displaying a Sitefinity Page as a RadWindow

All Replies

Posted by Community Admin on 03-Aug-2011 00:00

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?

Posted by Community Admin on 08-Aug-2011 00:00

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>
The code behind .ascx.cs
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);
        
    

Greetings,
Stanislav Velikov
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 09-Aug-2011 00:00

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?

Posted by Community Admin on 10-Aug-2011 00:00

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

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed