Posts

Showing posts from 2019

Event Receiver

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/403c001b-b720-4b12-bb5c-6b95c9fbaf89/how-to-get-column-values-on-item-added-event-receiver?forum=sharepointdevelopmentprevious https://www.red-gate.com/simple-talk/dotnet/net-tools/managing-itemupdating-and-itemupdated-events-firing-twice-in-a-sharepoint-item-event-receiver/ https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/ff521580(v%3Doffice.14) https://sharepoint.stackexchange.com/questions/216386/add-new-itemeventreceiver-methods-in-visual-studio-on-top-of-existing-event-rece https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/handle-list-item-events-in-the-provider-hosted-add-in using ( SPSite originalsite = new SPSite ( properties . SiteId , properties . OriginatingUserToken )) { //To get the current user using ( SPWeb web = originalsite . OpenWeb ()) { string strUserName = web . CurrentUser . LoginName . ToString (); } }

How to add webPart to Page with PowerShell from WebPart Gallery

https://sharepoint.stackexchange.com/questions/233319/how-to-add-webpart-to-page-with-powershell-from-webpart-gallery #ensure that you use the site collection root url #if you use subsite url, will throw error since webpart gallery #exists only in the site collection root site $web = Get - SPWeb "https://site-collection-url" $pubWeb = [ Microsoft . SharePoint . Publishing . PublishingWeb ]:: GetPublishingWeb ( $web ) $publishingPage = $pubWeb . GetPublishingPage ( "https://site-collection-url/Pages/Test.aspx" ); $publishingPage . CheckOut (); $list = $web . Lists [ "Web Part Gallery" ] #use the webpart title or the .webpart file name $wpl = $list . Items | where { $_ . Title - eq "Your Webpart Name" } $xmlReader = New - Object System . Xml . XmlTextReader ( $wpl . File . OpenBinaryStream ()); $errorMsg = "" $wpManager = $publishingPage . ListItem . File . GetLimitedWebPartManager ([ S...

HTTP 404 Not Found Error with .woff or .woff2 Font Files

https://hotcakescommerce.zendesk.com/hc/en-us/articles/210926903-HTTP-404-Not-Found-Error-with-woff-or-woff2-Font-Files https://weblog.west-wind.com/posts/2016/jan/25/fontawesome-fonts-and-mime-types-in-iis-and-other-web-servers <system.webServer> < staticContent > < clientCache cacheControlCustom = " public " cacheControlMode = " UseMaxAge " cacheControlMaxAge = " 365.00:00:00 " /> < remove fileExtension = " .woff " /> < remove fileExtension = " .woff2 " /> < mimeMap fileExtension = " .woff " mimeType = " application/x-font-woff " /> < mimeMap fileExtension = " .woff2 " mimeType = " application/font-woff2 " /> </ staticContent > < modules >