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


Top 5 Contributors of the Month
Kaviya Balasubramanian
Imran Ghani
Post New Web Links

Site Pages Library Event Handler not working

Posted By:      Posted Date: October 01, 2010    Points: 0   Category :SharePoint
 

Hi,

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.?




View Complete Post


More Related Resource Links

Event handler that will take an e-mail sent to a doc library and save it as an .MSG file within the

  
Hi All, I have a requirement to create an event handler that will take an e-mail sent to a doc library and save it as an .MSG file within the library? Any help/inputs on getting this done is much appreciated.  Hanif

Retract custom master page feature and all site pages stop working

  
There is a requirement to apply custom branding on personal sites in a SP 2010 project. For this I have created a feature which uploads and applies the custom master page on creation of any new personal sites.   I have stapled this feature (using feature stapling concept) to the “SPSPERS” (personal site) site definition. The custom master page is displayed on the creation of new personal sites. On feature deactivation, I am looping through all the personal sites (as the feature is deployed on a team site) and pointing the master URL back to v4.master. But when I retract the solution and browse to the personal site, I am getting a “404 File not found” error.  But am able to view the settings page by typing the URL.   I activated the publishing features and looked at the master page applied to the personal site. It was pointing to v4.master.   Any help on this is appreciated. Regards, Neha

Retract custom master page feature and all site pages stop working

  
I have stapled this feature (using feature stapling concept) to the “SPSPERS” (personal site) site definition. The custom master page is displayed on the creation of new personal sites. On feature deactivation, I am looping through all the personal sites (as the feature is deployed on the root site) and pointing the master URL back to v4.master. But when I retract the solution and browse to the personal site, I am getting a “404 File not found” error.  But am able to view the settings page by typing the URL.   I activated the publishing features and looked at the master page applied to the personal site. It was pointing to v4.master. Any help on this is appreciated. Regards, Neha    

Event Handler for library

  
Hi, Hi, I have a library with these fields(mailid,cost,mailid2), i need a validation of mailIds if already existing  mails three time  I need a validation for new request , I have user interface in InfoPath 201 0 , workflow SharePoint designer 2010 , everything is working now I need a validation mail id , if mail is already existing three time ,how to count mails ids individual mails how to i count Regards

Code in an event handler not working when used with system reflection.

  
Hi, I am presently writing an application that uses an MDI form with a ToolStrip on it. I have the need to build the menu items dynamically using an XML file. The format of the XML file is as follows: <ContextMenu EventHandlerHost="vFrmPDUsetup"> <!-- These styles will be applied to the menu items. Individual menu item styles can be override by defining as an attibute to the specific menu item, see below --> <Style> <MenuStripBackColour>Transparent</MenuStripBackColour> <BackColour></BackColour> <ForeColour>Chartreuse</ForeColour> <BackImage></BackImage> <!-- Must exist in Images folder --> <FontName>Tahoma</FontName> <FontSize>10</FontSize> <FontStyle>Bold</FontStyle> </Style> <!-- Attributes: Key = Resource Key name in resource file Image = image to display before text, image must exist in Images folder BackImage = background image, image must exist in Images folder BackColour = background colour as colour name ForeColour = foreground colour as colour name FontSize = size of font as value Seperator = add a menu seperator OnClick = click event pointing to the event handler method which must be defined as the MenuItem_ + <attibute value> &

Document Set not working from a Site/Library Template

  

Hi all,

found a strange bug ...

Created a site in SharePoint 2010, added the document set content type to a document library.  I then created some standard document sets within the document library to use in a site template.

However, when I created a new site from the site template the document sets appear as folders, with no document set info section when you go into them.  However when you do the drop down on the name in the library it shows "Document Set Version History".

It is as though the document sets were only half recreated.  I can create a new document set in the same library and that shows as it should.

Anyone else come across this?  Anyone have any tips or solutions? Incidentally the document sets are also not working when a new library is created from a library template.  They have the correct icon, but the link that has been automatically created does not work.

Oh, you can create new document sets within the newly created library (within site template or from a library template) and they work fine.  It is only document sets that are saved within the templates.

When looking at a document library from a template that included a document set the link to the document set itself has been recreated completely wrong.

This is the link on the original document set

When trying to create a site i get - 'Failed to create the 'Pages' library. Please Help...

  

Hi,

I get an error in SharePoint 2010 when trying to create a new site in my site collection root. I beleave I have set up everything correctly security-wise, but maybe I missed something. I am set as site collection owner.
http://wilfing.se/forum/server-error.gif

Any thoughts or ideas appreciated! Thank you in advance /Jesper Wilfing

EventLogger tells me:

 

Event log message was: 'Failed to create the 'Pages' library.'. Exception was: 'Microsoft.SharePoint.SPException: User cannot be found.

at Microsoft.SharePoint.SPUserCollection.get_Item(String loginName)

at Microsoft.SharePoint.Workflow.SPWorkflowNoCodeSupport.LoadWorkflowBytesElevated(SPFile file, Int32 fileVer, Int32& userid, DateTime& lastModified)

at Microsoft.SharePoint.Workflow.SPWorkflowManager.AddDeclSiteTemplates(SPWeb web, String visibility, SPWorkflowTemplateCollection wftemplates, SPListTemplateType templateType)

at Microsoft.SharePoint.Workflow.SPWorkflowManager.<>c__DisplayClass2.<RegisterNoCodeTemplates>b__0()

at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass4.<RunWithElevatedPrivileges>b__2()

at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)

at Microsoft.SharePoin

Event handler firing for one site but not for another

  

Hi,

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? 

 


Retract custom master page feature and all site pages stop working

  

I have stapled this feature (using feature stapling concept) to the “SPSPERS” (personal site) site definition. The custom master page is displayed on the creation of new personal sites. On feature deactivation, I am looping through all the personal sites (as the feature is deployed on the root site) and pointing the master URL back to v4.master. But when I retract the solution and browse to the personal site, I am getting a “404 File not found” error.  But am able to view the settings page by typing the URL.

 

I activated

Getting elevated site in Event Handler

  

Hello,

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

 

 

 

 

public override void ItemCheckedIn(SPItemEventProperties properties)
{

DisableEventFiring();

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

catch{ }

EnableEventFiring();
}

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

http://msdn.microsoft.com/en-us/library/bb687949.aspx

 

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 ?


Event handler: properties.AfterProperties on a document library ItemUpdated/ItemAdded event

  

In a ItemUpdated event on a list i normally i use "properties.ListItem" to get data before the changes, and "properties.AfterProperties" to get data after the chages

But when working with document libraries things get a lot complicated. The ItemAdded handler gets called when a file is uploaded, not when the user specifies it's metadata. To handle these metadata i have to use the ItemUpdated handler.
But even there it happens that "properties.ListItem" and "properties.AfterProperties" result both null, so i cannot access any data i need

Is there a way to get a document metadata when it is added to a library?


Web Part pages in the Pages library don't inherit the Site Icon?

  

I just noticed that for Web Part Pages created through the UI and placed into the Pages library don't seem to inherit the Site Icon. I tested this in two environments.

I want to keep using the Pages library as I've linked the page to the top link bar, and it highlights it properly if it's in the pages library. However I can't seem to be able to fix the Site Icon on that page. 

Is this a known bug or have I done something wrong?


Issue - Copy pages from one publsihing site to pages library in other publsihing site

  

Hi,

I have a strange issue, I am copying pages from pages library in one site : http://testsite/subsite1/ to http://testsite/subsite1/subsite2

the pages get copied, I can see the count increasing when page library is viewed from "View All site content", but when I open the library, it only shown default.aspx and not the copied pages. Can any one suggest what can be the reason. Is it related to some rights?

Count in page library shows it has 10 items but when I open library, it only shows 1 page.

Any help will be much appreciated.

Thanks in advance.


SharePoint Application and Site Pages - Part 1 of 2

  
In this first part of the two part series, Steven covers the differences between Site and Application pages in SharePoint 2007, why each may be used in various circumstances, and prepares for the construction of a menu located application page. After a brief introduction he examines the concept of Site Pages and Application Pages separately in detail with supported screenshots.

SharePoint Application and Site Pages - Part 2 of 2

  
As the second article in a two part series, Steven examines the attributes and details of a SharePoint 2007 application page, including the construction and feature deployment of the same page based project. Since this is a WSS level objective, as opposed to MOSS, you will not need MOSS to work with the code included in this project. Windows Server 2003, WSS, and Visual Studio 2005 are all that is needed, with no additional add-ons. He provides a detailed analysis of each step involved in the creation and deployment of the project.

how to check which pages of my site that my visitor visiting at the moment

  

 Hi all, and thanks a lot for the replies since now. I have a new question :

I prepared a simple instant messaging system for my web site and i would like to learn which visitor (registered member) is at which page of my site. 

For example : 

Uid:10000, Username:donald, NameSurname:Donald DUCK is a registered and signed in visitor.

I need the code which tells me that visitor is at which page (ie. images.aspx?imageid=143223)

Sorry for my poor english, and let me know if i should explain more clearly :)

Have a good evening...


Localization not working in class library (composite control)

  

Hi

I have a class library called WEM.portal which used Resource files to localise text in my composite controls.

I store my resource files (eg MyResourceFile1.resx) in App_GlobalResources folder and then refer to them using

MyLabel1.text = My.Resources.MyResourceFile1.MyResourceKey1

This is all working ok until I create seperate files for each language such as MyResourceFile1.FR-fr.resx.

I have implemented this throughout my other web applications but the Class Library doesnt seem to want to work the same way

When I load the page it correctly showes the resourced keys which I have done through the web application BUT the resource keys in the composite controls does not seem to pick up the culture code.

Am I missing something stupid. Ive tried

  • changing the Build Action on the resource file to Content and Custom tool to GlobalResourceProxyGenerator
  • Creating a resourceManager but to no avail



Snippet



Categories: 
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