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