Placeholder value
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
Placeholder value

 
Post new topic   Reply to topic    Windows Server Forum Index -> CMS Server
Author Message
gg
Guest





Posted: Tue Oct 25, 2005 8:51 am    Post subject: Placeholder value Reply with quote

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?
Back to top
Stefan [MSFT]
Guest





Posted: Tue Oct 25, 2005 12:50 pm    Post subject: Re: Placeholder value Reply with quote

Hi gg,

first of all: never use DataSource.RawContent.
See here for details:
http://blogs.technet.com/stefan_gossner/archive/2004/04/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...
Quote:
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?
Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> CMS Server All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB