开发者

Create AND add user to sharepoint site via code

开发者 https://www.devze.com 2023-01-20 20:57 出处:网络
I\'m curious about the best/most efficient way to do this. I\'ve already set up my sharepoint 2010 site, and it is configured to use FBA.What i\'d like to do is allow users to create their own accoun

I'm curious about the best/most efficient way to do this.

I've already set up my sharepoint 2010 site, and it is configured to use FBA. What i'd like to do is allow users to create their own accounts by filling out a form (the form will sit on a public sharepoint site, and filling it out creates a user in the membership database which is used for validation to enter the FBA sha开发者_StackOverflow中文版repoint site).

I'm familiar with using the asp CreateWizard tool to build user accounts as part of a .Net web application, but I'm not sure on how to develop this as a webpart for use in a sharepoint site, as a webpart doesn't have the config file to store connection string and membership/role provider info.

Can this user creation form be put in a webpart and deployed to other sites, or is there another/better way to add this functionality to sharepoint (allowing users to register/create their own FBA accounts for access)?


There's nothing not much difference between SharePoint and regular ASP.Net for this.

The membership provider will need to be configured in the SharePoint web.config, including connection strings. However, it does not actually need to be used for login, so you can still create users in that membership provide from a different site.

I use a slightly different approach though - set up an anonymously accessible page in your site (in layouts is probably easiest, though a page within a site may be better for branding) and put controls on that page to create (and log in) a new user. You will need to call EnsureUser and possibly CreateUserProfile to give the new user access to anything, but aside from that it's all standard .net.

0

精彩评论

暂无评论...
验证码 换一张
取 消