Microsoft Content Management Server - Placeholder value

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > October 2005 > Placeholder value





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 Placeholder value
gg

2005-10-25, 7:48 am

Hi i assign a dateTime value to a placeholder by this events

void Selection_Change(Object sender, EventArgs e)
{
Posting thisPosting = CmsHttpContext.Current.Posting;
TXTNewsExpirationDate.Text="";
foreach(DateTime day in Calendar1.SelectedDates)
{
TXTNewsExpirationDate.Text += day.Date.ToShortDateString();
thisPosting.Placeholders["PHExpirationDate"].Datasource.RawContent=TXTNewsExpirationDate.Text.ToString();
}
}
the value is write on the placeholder while the event is raised, but
when i reload the template after saving it, the placeholder is empty.
Why?

Stefan [MSFT]

2005-10-25, 7:48 am

Hi gg,

first of all: never use DataSource.RawContent.
See here for details:
http://blogs.technet.com/stefan_gos.../24/119546.aspx

In addition: settings a placeholder value in a button event is usually not
possible as you need to be in update mode to update a placeholder and I
assume that CmsHttpContext.Current.Mode will be Unpublished and not Update
in this event handler.

What you could do is to update the content of the placeholder control. Is
this what you are looking for?

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
----------------------


"gg" <gigino@gmail.com> wrote in message
news:1130227595.667861.51280@z14g2000cwz.googlegroups.com...
> Hi i assign a dateTime value to a placeholder by this events
>
> void Selection_Change(Object sender, EventArgs e)
> {
> Posting thisPosting = CmsHttpContext.Current.Posting;
> TXTNewsExpirationDate.Text="";
> foreach(DateTime day in Calendar1.SelectedDates)
> {
> TXTNewsExpirationDate.Text += day.Date.ToShortDateString();
> thisPosting.Placeholders["PHExpirationDate"].Datasource.RawContent=TXTNewsExpirationDate.Text.ToString();
> }
> }
> the value is write on the placeholder while the event is raised, but
> when i reload the template after saving it, the placeholder is empty.
> Why?
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com