Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Is is possible to create a new page from my own class and not from the controller?
I am trying to move this code:
var newComment = Services.ContentService.CreateContent("Comment", CurrentPage.Id, "comment"); newComment.SetValue("visitorName", model.Name); newComment.SetValue("visitorEmail", model.Email); newComment.SetValue("visitorComment", model.Comment); Services.ContentService.Save(newComment);
to my own class in order to keep the controller as clean as possible, but I don't have any access to the CreateContent method, even after I tried to add different references.
I am using umbraco 6.1.6
Moran,
Try ApplicationContext.Current.Services.ContentService in your class.
Regards
Ismail
Working :)
Thanks
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
create a new page from my own class
Is is possible to create a new page from my own class and not from the controller?
I am trying to move this code:
to my own class in order to keep the controller as clean as possible, but I don't have any access to the CreateContent method, even after I tried to add different references.
I am using umbraco 6.1.6
Moran,
Try ApplicationContext.Current.Services.ContentService in your class.
Regards
Ismail
Working :)
Thanks
is working on a reply...