5/21/2012 12:21:43 PM
3016
Reputation
428
Total posts
Hi,
Regarding the users blog, below is a code that you can use during the registration. It will create a blog for user:
public
void
CreateBlogForUser(MembershipUser user)
{
BlogEntity blog =
new
BlogEntity(GuidExtension.NewSequentialGuid());
blog.Name = user.UserName;
blog.Slug = UrlSeoOptimizer.GetOptimizedString(blog.Name);
blog.DateCreated = DateTime.Now;
blog.UserId =
new
Guid(user.ProviderUserKey.ToString());
blog.ApplicationId = MembershipRepository.GetInstance().GetApplicationId();
blog.LanguageId = LocalizationUtility.GetCurrentLanguageId();
MonoXCacheManager cacheManager = MonoXCacheManager.GetInstance();
cacheManager.RemoveAll(CacheKeys.Blog.Root);
cacheManager.RemoveAll(CacheKeys.Blog.Editors);
using
(BlogRepository rep = BlogRepository.GetInstance())
rep.SaveBlog(blog);
}
Registration happens in Monox Membership editor. So you should use MembershipEditor's
AccountCreated event and there create a blog for particular user.
More about extending the MonoX Membership editpr can be found
here.
Regards
Rating history (Content is rated 0.00 of 0 vote(s).)
Shows who have rated the content, and the rating score.