.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

How to get Site Provision Event ?

Posted By:      Posted Date: December 04, 2010    Points: 0   Category :SharePoint

Hi All,

I am creating custom site defination project using VS2010 and Sharepoint Foundation 2010.

My project have web event receiver class. On the web provision event I create some custom list & custom pages.This project is depolied on root site collection and then create new site collection using my custom template this is working fine. But when I create root site collection from central admin using my custom template that time provision event not fire.

Thanks in advance.



View Complete Post

More Related Resource Links

trigger an automatic sharepoint site provision event from within Office project 2010



can anyone give me an idea on what i could do to automate the site creation in sharepoint when i press the sync button in project ? thanks

Why feature with event receiver doesn't activate properly after site provisioning?



I have defined feature with event receivers for my document library and for users List .

I try to activate my feature in onet.xml in section <WebFeatures>. After provisioning a new site from onet.xml  all work fine and my feature is shown as activated, but event receivers doesn't fire. It fires only after reactivating my feature (deactivate, then activate it again). But I need my feature works immediately after site provisioning without deactivating and activating it again. Who knows how to solve this problem?

part of ONET.xml



        <Feature ID="00BFEA71-4EA5-48D4-A4AD-7EA5C011ABE5"/>

        <!-- TeamCollab Feature -->

        <Feature ID="F41CC668-37E5-4743-B4A8-74D1DB3FD8A4"/>

        <!-- MobilityRedirect -->

        <!--My EventReceivers Feature-->

        <Feature ID ="41178843-A6A4-47c7-9EF9-B8A432E02B88"></Feature>





ASP.Net event id 1334 SRS Reports site not available yet reportserver is

We have a SQL 2008 SP1 server running on Windows Server 2008R2. It holds the DataWarehouse for our SCOM2007R2 environment. Up until last month http://server/reports worked fine and allowed users access to out pre-configured reports. However it was noticed recently that this site is no longer available. Testing from localhost also failed, no permissions had been changed. However we are getting the following Event ID 1334 for ASP.NET 2.0.50727.0:- Failed to initialize the AppDomain:ReportManager_MSSQLSERVER_0 Exception: System.Configuration.ConfigurationErrorsException Message: Unrecognized element. (C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportManager\web.config line 18) StackTrace: at System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags) at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters) at System.Web.Hosting.Appl

Running code after site definition site creation in a event receiver or feature receiver

Hi guys I've got a site definition which is pretty much based on STS.This is it's own sharepoint project. Let's call this project SiteDefProj. Next in another SharePoint project (same solution though). Let's call this CustomListProject. In this project I've got a feature which provisions a bunch of lists based on custom content types - this feature is a site scoped. Let's call this feature: CustomListInstances. I have added a feature receiver to this feature to execute some custom code on the lists themselves (under feature activated) In my ONET.XML (part of the SiteDefProj) I have CustomListInstances feature ID as part of my <sitefeatures>. When I do a create site I can actually step through the code and see it actually being executed but after the site is created the list instances are created but it's like the code never run or did anything. The weird part is that stepping through the code while creating a site collection using my SiteDefProj the code runs great with no errors. All lists are there and the code runs smooth. If I manually create a STS site and activate my feature everything works and the code does actually run and the effects are visible after the feature is created. Again I can actually step through it in debug. My suspicion is that there's some sort of a race condition in the CREATE SITE functionality where maybe the web or site collection hol

How do I trap site creaeted event in sharepoint 2010.

I want to trap the site created event in sharepoint 2010. I have created custom site defintion and master page incorporated into that. For every site creation i want to inherit site from custom master page. so i need a site created event. Can any one suggest me how can i proceed.?

CAML RichText site column provision not working properly


I have used the following CAML declaration in a feature to provision some site columns:

  DisplayName="Test Rich Text

Site Pages Library Event Handler not working



I have created an event handler for Site Pages library in SharePoint 2010. In event Handler I have given the list template id (119 - wiki web page library) but the event handler is not working. Do I need to use different list template id for this.?

Provision Shared Documents List View Web Part in Site Template


I'm trying to add the Shared Documents "web part" that is part of the default Team Site template to a custom site template.  However, from what I've found this is not really a web part for Shared Documents, but a generic List View web part with Shared as the data source.  Also, I don't see where this is listed in the onet.xml file of the Team Site template (which I believe is the "sts" template, correct?).  Also, you cannot export/download the xml for this webpart from the page and when it is viewed via SP Designer, the way it is defined is not supported in an onet.xml file. 

So how do you add this webpart to a site template?

Provision/Add custom Layout, Master and Default pages in Site Template


I'm attempting to use the onet.xml of a custom Site Template to provision/add (same thing?) a custom Master Page, a Custom Layout page and then reference them in Configurations.

I'm having trouble understanding the steps and order to do this in properly and am getting errors where the Layouts/Master pages cannot be found.  Here is what I have now:

<Module Name="SitesLayout" Url="_catalogs/masterpage" Path="Layouts" RootWebOnly="false">

  <File Url="SitesLayout.aspx" Type="GhostableInLibrary"><Property Name="Title" Value="AEP Sites Layout Template" /></File>


<Module Name="AEPMasterPage" Url="_catalogs/masterpage" RootWebOnly="false">

     <File Url="CustomMaster.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="true" />


<Module Name="DefaultFunctional" Url="Pages" Path="">

     <File Name="MyDefault.aspx" Url="DefaultOrgFuncHomePage\default.aspx" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE">

     <Property Name="Title" Val

How to Provision Javascript In site definition?

How to Provision Javascript In site definition??

Get the Sign In as a different user event in sharepoint site.



i want to save some data for a each user when he/she log out from a sharepoint site ,

so can i get the  event of "sign in as a diffenrent user" in sharepoint .

Event handler firing for one site but not for another



I have an event handler that is working just fine on a list in one site, but when I bind it to the other list in another site, it binds properly, but never fires. Any suggestion? 


Getting elevated site in Event Handler



In ItemCheckingIn and ItemCheckedId event handlers, I need elevated site since I'm deleting / adding new documents.





public override void ItemCheckedIn(SPItemEventProperties properties)


using (SPSite site = SecurityHelper.GetElevatedSite(properties.ListItem.Web.Site))
		using (SPWeb web = site.OpenWeb(properties.ListItem.Web.ID))
			// do some strange things			

catch{ }


But according to the best practices, Its a bad idea to instantiate a new SPSite and SPWeb object. (obviously, for performance reasons..)



Since I need elaveted web in both event handlers, I'll have double performance penalty. I was thinking to make us of caching, but SPSite or SPWeb is not thread safe, so cannat be cached..


Is there any better way ?

Import Events from Calendar Site to web part event.


Hey experts!

I'm having problem on which i want to view the events from this site navigation: Home>Calendar>Public Calendar to be appear on the Homepage. I tried to user Event web part, but the navigation is from Home > Events.

So, its difficult for my user when they have created events in the Public Calendar, and automatically can be view in the Homepage is not possible. I tried using workflow, but it does not work.

What i want is the calendar part in the Home > Calendar > Public Calendar can also be view in the Homepage. I dont mind if there is any paid web part to be use as long as it can meet my requirements.

How to provision a WIKI site as a sub site in a custom Site definition?


Hi all,

I have a custom Site definition which is made up of team Site Template(STS). In that I have populated lists and content types according to my requirement. Now I need to provision a WIKI site as a sub site in that Definition. I have used Provision data attribute of Configuration element in webtemp file and defined structure for it. But my site is not being created. The same approach is working with default Publishing sites provided by MOSS 2007(Publishing and collaboration Portals). I suspect that Publishing feature needs to be activated in my template before using provisioning attribute. Is that true. If yes please throw some light on that process. if no, guide me through the next possible solution.


Changing the graphics on the home page of a SharePoint site

When you create a site in Microsoft Windows SharePoint Services by using the default Team Site template, the home page includes two default graphics. A Windows SharePoint Services graphic appears in the body of the page, and a picture of a house in a circle appears near the site title. You can change these graphics to customize your site. Changing the smaller graphic requires a Windows SharePoint Services compatible Web page editor

Take a tour of your SharePoint site

What is a SharePoint site for?
A SharePoint site is a Web site that provides a central storage and collaboration space for documents, information, and ideas. A SharePoint site is a tool for collaboration, just like a telephone is a tool for communication, or a meeting is a tool for decision making. A SharePoint site helps groups of people (whether work teams or social groups) share information and work together. For example, a SharePoint site can help you:

Coordinate projects, calendars, and schedules.
Discuss ideas and review documents or proposals.
Share information and keep in touch with other people.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend