03-08-07 06:18 PM
Hi John,
do just this:
string content = phCMS.Html.Replace("~LT~","<").Replace("~GT~",">")
(this is C# code. You need to translate it into VB.NET)
Cheers,
Stefan
"John" <john.way@milliken.com> wrote in message
news:1173371797.500393.313240@n33g2000cwc.googlegroups.com...
OK, I was using the wrong namespace. I should have been looking in
Microsoft.ContentManagement.Publishing.Extensions.Placeholders.HtmlPlacehold
er.
However, the HTML I got back was not what I expected. I was hoping
that this method would bring back clean HTML versus using the
rawcontent method. This content was created by a telerik control so I
have "~" everywhere.
To solve this problem, I tried the follwoing code, but I'm not getting
anything back from the phRad.HTML call. Can you help?
Private Function GetCMSContent(ByVal pstrPostingName As String, ByVal
pstrPlaceholderName As String, ByVal pstrChannelPath As String) As
String
Dim phCMS As
Microsoft.ContentManagement.Publishing.Extensions.Placeholders.HtmlPlacehold
er
Dim phRad As New
Telerik.WebControls.RadEditorPlaceHolderControl
Dim channel As Channel
Dim posting As Posting
Dim strContent As String = ""
channel =
CmsHttpContext.Current.Searches.GetByPath(pstrChannelPath)
If Not IsNothing(channel) Then
For Each posting In channel.Postings
If
posting.Name.ToLower.Equals(pstrPostingName.ToLower) Then
phCMS =
posting.Placeholders.Item(pstrPlaceholderName)
phRad.BoundPlaceholder = phCMS
phRad.DataBind()
strContent = phRad.Html
Exit For
End If
Next
End If
Return strContent
End Function
Thanks,
John
On Mar 8, 2:35 am, "Stefan Goßner [MSFT]"
<stef...@online.microsoft.com> wrote:[vbcol=seagreen]
> Hi John,
>
> you need to cast for HtmlPlaceholder and define phCMS as HtmlPlaceholder.
> Not as HtmlPlaceholderControl.
>
> Cheers,
> Stefan
>
> "John" <john....@milliken.com> wrote in message
>
> news:1173304741.880588.165960@p10g2000cwp.googlegroups.com...
>
>
>
>
>
>
>
>
>
>
>
[ Post a follow-up to this message ]
|