hello All:
when I want to create a posting using the following code ,it repalies a
exception:
System.Runtime.InteropServices.COMException: Invalid mode for update. The
requested action modifies the state of an object and can only be performed
when the session is in the 'Update' mode.
but i have change to the update mode:
how can i to deal with it
??! help ! thank you
here is the code:
CmsApplicationContext cmsAppConontext=new CmsApplicationContext();
cmsAppConontext.AuthenticateAsUse(name,passwordPubli****ngMode.Published);
string path="/Channels/ccclub.cmbchina.com/servicecenter/"+channelName;
(Channel) postr=(Channel)cmsAppConontext.Searches.GetByPath(path);
if(cmsAppConontext.UserCanAuthor)
{
Template
objTemplate=(Template)cmsAppConontext.Searches.GetByPath("/Templates/CreditCard/special/clubqa/noticetem");
Posting pageNew=objNavChannel.CreatePosting(objTemplate);
pageNew.Approve();
cmsAppConontext.CommitAll();
}
regard!