Microsoft Content Management Server - Url Replacement in HTMLplaceholder results ?nrmode=unpublished url

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > August 2005 > Url Replacement in HTMLplaceholder results ?nrmode=unpublished url





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 Url Replacement in HTMLplaceholder results ?nrmode=unpublished url
Danny Hille

2005-08-25, 7:48 am

Hi I Have a robot (a aspx page running from a sheduled task, auth. as
administrator)
that replaces a all profane language (from a banned word list)
that works ok ... except that all MCMS urls are replaced with
?nrmode=unpublished urls ????

in short the code looks like this:


CmsApplicationContext Cac = null;
try
{
Cac =new CmsApplicationContext();
Cac. AuthenticateAsCurrentUser(PublishingMode
.Update);
Posting Pos = Cac.Searches.GetByGuid(pguid)as Posting;
for(int i=0;i<Pos.Placeholders.Count;i++)
{
if()
Pos.Placeholders[i].Datasource.RawContent =
ReplaceBannedWords(Pos.Placeholders[i].Datasource.RawContent);
}
if(Pos.CanSubmit)Pos.Submit();
if(Pos.CanApprove)Pos.Approve();
Cac.CommitAll();
}
catch(Exception Exc)
{
Response.Write(Exc.ToString());
}
finally
{
if(Cac!=null)Cac.Dispose();
}


Thanks in advance
Danny Hille
Stefan [MSFT]

2005-08-26, 7:53 am

Hi Danny,

never ever use datasource.rawcontent.
See here for explanation:
http://blogs.technet.com/stefan_gos.../24/119546.aspx

Check if this solves the problem.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------


"Danny Hille" <DannyHille@discussions.microsoft.com> wrote in message
news:5B6125F0-012C-4D6C-A4D0-2810F7C82C5B@microsoft.com...
> Hi I Have a robot (a aspx page running from a sheduled task, auth. as
> administrator)
> that replaces a all profane language (from a banned word list)
> that works ok ... except that all MCMS urls are replaced with
> ?nrmode=unpublished urls ????
>
> in short the code looks like this:
>
>
> CmsApplicationContext Cac = null;
> try
> {
> Cac =new CmsApplicationContext();
> Cac. AuthenticateAsCurrentUser(PublishingMode
.Update);
> Posting Pos = Cac.Searches.GetByGuid(pguid)as Posting;
> for(int i=0;i<Pos.Placeholders.Count;i++)
> {
> if()
> Pos.Placeholders[i].Datasource.RawContent =
> ReplaceBannedWords(Pos.Placeholders[i].Datasource.RawContent);
> }
> if(Pos.CanSubmit)Pos.Submit();
> if(Pos.CanApprove)Pos.Approve();
> Cac.CommitAll();
> }
> catch(Exception Exc)
> {
> Response.Write(Exc.ToString());
> }
> finally
> {
> if(Cac!=null)Cac.Dispose();
> }
>
>
> Thanks in advance
> Danny Hille



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com