|
Home > Archive > Microsoft Content Management Server > April 2005 > tree structure of channels
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
tree structure of channels
|
|
| Dariusz Tomon 2005-04-26, 5:54 pm |
| Hi
Below I present code "stolen" from "A complete guide for MCMS". It is for
creating tree control reflecting the structure of channels:
using System;
using Microsoft.ContentManagement.Publishing;
using Microsoft.ContentManagement.Publishing.Extensions.Placeholders;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
//using System.Windows.Forms;
namespace isic2
{
/// <summary>
/// Summary description for one.
/// </summary>
public class one : System.Web.UI.Page
{
protected Telerik.WebControls.RadEditorPlaceHolderControl zajawka1;
protected Telerik.WebControls.RadEditorPlaceHolderControl tytul;
protected System.Web.UI.WebControls.LinkButton link1;
protected Telerik.WebControls.RadEditorPlaceHolderControl pelny1;
protected Telerik.WebControls.RadEditorPlaceHolderControl zajawka2;
protected System.Web.UI.WebControls.LinkButton link2;
protected Telerik.WebControls.RadEditorPlaceHolderControl pelny2;
protected System.Web.UI.WebControls.Label lab1;
protected Microsoft.ContentManagement.WebControls.RobotMetaTag
RobotMetaTag1;
//protected Microsoft.Web.UI.WebControls.TreeView mytree;
protected Microsoft.Web.UI.WebControls.TreeView myTreeView;
public void BuildSiteMap(Channel startChannel, System.Windows.Forms.TreeNode
parentTreeNode)
{
// Create a new tree node
System.Windows.Forms.TreeNode myNewNode = new
System.Windows.Forms.TreeNode();
// Add the styles we want to our node (yes, we could have used
// CSS, but we were lazy)
//myNewNode.DefaultStyle.Add("FONT-FAMILY","verdana");
//myNewNode.DefaultStyle.Add("FONT-WEIGHT","bold");
//myNewNode.DefaultStyle.Add("COLOR","gray");
// Set the NavigateUrl property to the URL of the current channel
// Set the Text property to the displayname
myNewNode.NavigateUrl = startChannel.Url;
...............
During compilation I get error that myNewNode does not have NavigateUrl
method.
Maybe I'm using wrong namespace: System.Windows.Forms for the tree class?
I'm also interested in using component or method for displaying the path
where actually we are when traversing the web service.
best regards
Darek
| |
| Dariusz Tomon 2005-04-26, 5:54 pm |
| Ok never mind I've just solved this prob.
Użytkownik "Dariusz Tomon" <d.tomon@mazars.pl> napisał w wiadomości
news:O#POiUqSFHA.3696@TK2MSFTNGP15.phx.gbl...
> Hi
>
> Below I present code "stolen" from "A complete guide for MCMS". It is for
> creating tree control reflecting the structure of channels:
>
> using System;
>
> using Microsoft.ContentManagement.Publishing;
>
> using Microsoft.ContentManagement.Publishing.Extensions.Placeholders;
>
> using System.Collections;
>
> using System.ComponentModel;
>
> using System.Data;
>
> using System.Drawing;
>
> using System.Web;
>
> using System.Web.SessionState;
>
> using System.Web.UI;
>
> using System.Web.UI.WebControls;
>
> //using System.Windows.Forms;
>
> namespace isic2
>
> {
>
> /// <summary>
>
> /// Summary description for one.
>
> /// </summary>
>
> public class one : System.Web.UI.Page
>
> {
>
> protected Telerik.WebControls.RadEditorPlaceHolderControl zajawka1;
>
> protected Telerik.WebControls.RadEditorPlaceHolderControl tytul;
>
> protected System.Web.UI.WebControls.LinkButton link1;
>
> protected Telerik.WebControls.RadEditorPlaceHolderControl pelny1;
>
> protected Telerik.WebControls.RadEditorPlaceHolderControl zajawka2;
>
> protected System.Web.UI.WebControls.LinkButton link2;
>
> protected Telerik.WebControls.RadEditorPlaceHolderControl pelny2;
>
> protected System.Web.UI.WebControls.Label lab1;
>
> protected Microsoft.ContentManagement.WebControls.RobotMetaTag
> RobotMetaTag1;
>
> //protected Microsoft.Web.UI.WebControls.TreeView mytree;
>
> protected Microsoft.Web.UI.WebControls.TreeView myTreeView;
>
> public void BuildSiteMap(Channel startChannel,
System.Windows.Forms.TreeNode
> parentTreeNode)
>
> {
>
> // Create a new tree node
>
> System.Windows.Forms.TreeNode myNewNode = new
> System.Windows.Forms.TreeNode();
>
> // Add the styles we want to our node (yes, we could have used
>
> // CSS, but we were lazy)
>
>
> //myNewNode.DefaultStyle.Add("FONT-FAMILY","verdana");
>
> //myNewNode.DefaultStyle.Add("FONT-WEIGHT","bold");
>
> //myNewNode.DefaultStyle.Add("COLOR","gray");
>
> // Set the NavigateUrl property to the URL of the current channel
>
> // Set the Text property to the displayname
>
> myNewNode.NavigateUrl = startChannel.Url;
>
> ..............
>
>
>
> During compilation I get error that myNewNode does not have NavigateUrl
> method.
>
> Maybe I'm using wrong namespace: System.Windows.Forms for the tree class?
>
> I'm also interested in using component or method for displaying the path
> where actually we are when traversing the web service.
>
>
>
> best regards
>
>
>
> Darek
>
>
>
>
|
|
|
|
|