CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of Sharepoint
C#
var reverter = new RevertToAppPool();
try
{
    reverter.UseAppPoolIdentity();
}
finally
{
    reverter.ReturnToImpersonatingCurrentUser();
}
by jaredmroberts   May 11, 2012 @ 11:05am
13 Views
no comments
 
C#
SPListItem item = properties.ListItem;
 
SPFieldUser userField = (SPFieldUser)item.Fields.GetField("Customer");
SPFieldUserValue fieldValue = (SPFieldUserValue)userField.GetFieldValue(item[userField.ID].ToString());
string customerEmail = fieldValue.User.Email;
by jaredmroberts   December 15, 2011 @ 1:35pm
91 Views
no comments
 
C#
Sol Reqs:
.NET 3.5
x64
Add Ref: Microsoft.SharePoint assembly 
 
// Applying a template to a new site
Site Actions –> New Site. You'll find your Site Template in the list of Installed Items, in the All Categories or Blank & Custom filters.
 
//  how to upgrade the content database - after applying SP1
C:\Program Files\Common Files\Microsoft Shared\Web ServerExtensions\14\bin\psconfig.exe –cmd upgrade
by Jose David Parra   August 11, 2011 @ 7:48pm
307 Views
no comments
 
Get-Process | Where-Object {$_.ProcessName -like "w*"}
 
Table 1-4. Commonly Used Windows PowerShell Comparison Operators
 
Operator    Purpose
-lt    Less than
-le    Less than or equal to
-gt    Greater than
-ge    Greater than or equal to
-eq    Equal to
by Jose David Parra   August 10, 2011 @ 3:42pm
120 Views
no comments
 
C#
namespace SharePointUpload {
    class Program {
        static void Main(string[] args) {
            ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback((a, b, c, d) => { return true; });
            WEB_REFERENCE_NAME.Imaging img = new WEB_REFERENCE_NAME.Imaging();
            img.UseDefaultCredentials = true;
            img.Url = "SHAREPOINT_SITE/_vti_bin/imaging.asmx";
            try {
                foreach (string filename in Directory.GetFiles("LOCAL_FOLDER")) {
                    img.Upload("PICTURE_LIBRARY_NAME", "PICTURE_FOLDER_IF_ANY", File.ReadAllBytes(filename), Path.GetFileName(filename), true);
by Veshiy0leg   May 31, 2011 @ 2:26pm
155 Views
no comments
 
C#
namespace SharePointUpload {
    class Program {
        static void Main(string[] args) {
            ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback((a, b, c, d) => { return true; });
            WEB_REFERENCE_NAME.Imaging img = new WEB_REFERENCE_NAME.Imaging();
            img.UseDefaultCredentials = true;
            img.Url = "SHAREPOINT_SITE/_vti_bin/imaging.asmx";
            //img.up
            try {
                //var x = img.GetListItems("Implementation Team Photos", "");
by Veshiy0leg   May 31, 2011 @ 2:25pm
104 Views
no comments
 
<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
    <style type="text/css">
          .sys-template
          {
            display: none;
          }
    </style>
    
<script src="../Scripts/MicrosoftAjax/MicrosoftAjax.js" type="text/javascript"></script> 
<script src="../Scripts/MicrosoftAjax/MicrosoftAjaxDataContext.js" type="text/javascript"></script>
by Ross   August 11, 2010 @ 7:41am
645 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate