Hi,
How to create different Site Collection Programmatically as a Visual Web Part in Top Level Site Collection in same web Application.
Technology Tips and News
Hi,
How to create different Site Collection Programmatically as a Visual Web Part in Top Level Site Collection in same web Application.
Ravi,
You can run PowerShell script for creating site collection in webpart.
I haven't tried myself but below link can help you to
Take a look at http://www.codeproject.com/KB/cs/HowToRunPowerShell.aspx. This is the type of code you'll need to write/consider.
Hi,
According to your description, my understanding is that you want to create different site collection in the same web application using web part in top level site collection.
I suggest you can create a custom web part and with the code snippet like below to create site collection for the specific web application:
string SiteCollectionUrl = "/sites/test3"; Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(() => { var Application = SPWebApplication.Lookup(new Uri("http://sp2013sps/")); Application.Sites.Add(SiteCollectionUrl, "TeamSite Created By C#", string.Empty, 1033, "STS#0", "contoso\\Administrator", "contoso\\Administrator", String.Empty); });
Thanks
Best Regards