Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > Cmserver Evaluation > Login attempt f...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 542 of 601
Post > Topic >>

Login attempt failed. Access is denied

by "Burak Kadirbeyoglu" <bkadirbeyoglu@[EMAIL PROTECTED] > Jan 26, 2006 at 02:47 PM

Dear CMS Developers,

I want to set the values of custom properties of the postings created from
a
specific template programmatically. I'm using following code in
global.asax.cs:

public void CmsPosting_Creating(Object sender, CreatingEventArgs e)
{
       CmsApplicationContext cmsAppContext = new CmsApplicationContext();
       cmsAppContext.AuthenticateAsCurrentUser(Publi****ngMode.Update);
       string GUID = CmsHttpContext.Current.Posting.Guid;
       Posting posting = (Posting) cmsAppContext.Searches.GetByGuid(GUID);

       if (posting.Template.SourceFile ==
"/Templates/TR/Default/News.aspx")
       {
            posting.CustomProperties["DAY"].Value = "8";
            cmsAppContext.CommitAll();
       }
}

When I'm saving a new posting, the following exception is thrown:

Login attempt failed. Access is denied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Login
attempt failed. Access is denied.

I guess it's related with CmsApplicationContext, isn't it? Can I use
CmsHttpContext instead?

Thanks in advance,

Burak Kadirbeyoğlu
 




 3 Posts in Topic:
Login attempt failed. Access is denied
"Burak Kadirbeyoglu&  2006-01-26 14:47:16 
Re: Login attempt failed. Access is denied
"Stefan [MSFT]"  2006-01-26 14:22:30 
Re: Login attempt failed. Access is denied
"Burak Kadirbeyoglu&  2006-01-26 16:50:05 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 22:09:43 CST 2008.