Microsoft Content Management Server - RE: How do I set a custom property attribute when creatingt a new post

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > June 2004 > RE: How do I set a custom property attribute when creatingt a new post





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 RE: How do I set a custom property attribute when creatingt a new post
Randall

2004-06-29, 5:52 pm

Eric,

How did you set the custom properties on the CmsPosting_Changed event handler?
Can you please share the code?

I appreciate your help.

Regards,
Randall


"eric" wrote:

> I would like to be able to display the CustomProperties for postings
> in dropdowns on the page in author mode instead of having the content
> authors having to go into the page properties screen. Here is one of
> my drop-down list examples.
>
> Posting State when recieving error;
> NRMODE=Unpublished
> WBCMODE%3dAuthoringNew%26nr_emit%3dThinE
dit%26wbc_purpose%3dAuthoring
>
> private void DropDownListType_SelectedIndexChanged(ob
ject sender,
> System.EventArgs e)
> {
> Microsoft.ContentManagement.Publishing.CmsApplicationContext
> appContext = new CmsApplicationContext();
> appContext. AuthenticateAsUser(username,password,Pub
lishingMode.Update);
> Posting posting = appContext.Searches.GetByGuid(context.Posting.Guid)
> as Posting;
> **posting.CustomProperties["Type"].Value =
> this.DropDownListType.SelectedValue;
> appContext.CommitAll();
> appContext.Dispose();
> }
>
> ** is where I am getting this error "Object reference not set to an
> instance of an object"
>
> Thanks for your help.
>
> Eric
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com