Thursday, December 24, 2015

SharePoint Full Control but Access Denied

Issue: 

User has Full Control on a Sub-Site but when he try to edit any page in this site SharePoint show Access Denied message.


Reason:

User doesn't have access to master page gallery

Solution:

Navigate to Site Collection Settings >> Galleries >> Master pages (http://server_name/_catalogs/masterpage/Forms/AllItems.aspx)


Then to Library Settings >> Select Permissions for this document library

On permissions page check if SharePoint Group "Style Resource Readers" has Read permission (This group contains "NT AUTHORITY\Authenticated Users" )

Monday, December 21, 2015

Only Content controls are allowed directly in a content page that contains Content controls


Error

"PlaceHolderPageTitle" place holder is case sensitive change  <asp:content/> to <asp:Content/>

<asp:Content contentplaceholderid="PlaceHolderAdditionalPageHead" runat="server">

</asp:Content>

Monday, December 15, 2014

JAVA Cheat Sheet

A great reference for the basics you need to know about JAVA, like structure, input/output, data types, and functions. Check out below links





Tuesday, November 04, 2014

Arabic Language Pack for SharePoint 2013 & Service Pack 1

Arabic Language Pack

  • For SharePoint Foundation 2013 - ( Download )
  • For SharePoint Server 2013 - ( Download )

Service Pack 1 for Arabic Language Pack 
  • For SharePoint Server 2013 Language Pack (KB2880554) - ( Download )
  • For SharePoint Foundation 2013 Language Pack (KB2880555) - ( Download )

Sunday, March 23, 2014

.NET Framework 4 and 4.5 Global Assembly Cache

Starting with the .NET Framework 4, the default location for the global assembly cache is %windir%\Microsoft.NET\assembly. 

In earlier versions of the .NET Framework, the default location is %windir%\assembly.



Tuesday, January 14, 2014

Backup / Restore SharePoint site collection using PowerShell or STSADM commands


  • Backup Using PowerShell
Backup-SPSite <URL of the site collection (Ex, http://server_name/sites/site_name)> -Path <full path to the backup file (Ex, C:\Backup\site_name.bak)>
  • Backup Using STSADM
stsadm -o backup -url <URL of the site collection (Ex, http://server_name/sites/site_name)> -filename <full path to the backup file (Ex, C:\Backup\site_name.bak)> -overwrite
  • Restore Using PowerShell
Restore-SPSite <URL of the site collection (Ex, http://server_name/sites/site_name)> -Path <full path to the backup file (Ex, C:\Backup\site_name.bak)> -Force 
  • Restore Using STSADM
stsadm -o restore -url <URL of the site collection (Ex, http://server_name/sites/site_name)> -filename <full path to the backup file (Ex, C:\Backup\site_name.bak)> -overwrite

Note: Using of -overwrite or -Force to overwrite an existing backup file or site collection if it already exists.

Monday, January 13, 2014

SharePoint configration database connection string

Connection string for SharePoint configuration database can be found on SharePoint servers registry under below registry path registry key dsn

  • SharePoint 2007

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Secure\ConfigDB

  • SharePoint 2010

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\Secure\ConfigDB

  • SharePoint 2013

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\15.0\Secure\ConfigDB


Sunday, January 12, 2014

Install SharePoint solution using PowerShell or STSADM commands

First make sure to log in to SharePoint server (Application server is preferred) with Farm admin account and run PowerShell or command line as administrator


  • Install Solution Using PowerShell
> Add-SPSolution <solution file name>
> Install-SPSolution -Identity <solution name> -WebApplication <virtual server url> -GACDeployment
  • Install Solution Using STSADM
> stsadm -o addsolution -filename <solution file name>
> stsadm -o deploysolution -name <solution name> -url <virtual server url>
  • Uninstall Solution Using PowerShell
> Uninstall-SPSolution -Identity <solution name> -AllWebApplications
> Remove-SPSolution -Identity <solution name>
  • Uninstall Solution Using STSADM
> stsadm -o retractsolution -name <solution name> -url <virtual server url> -immediate
> stsadm -o deletesolution -name <solution name>

Sunday, January 05, 2014

Read Only / Non-Editable TextBox


To make Text box Read only (or Non-Editable) without disable it and appear on gray style by adding the following attributes to TextBox tag

<asp:TextBox ID="txtBox1" runat="server" onkeypress="return false;" onpaste="return false;" Text="Read Only TextBox" />

OR

<asp:TextBox ID="txtBox2" runat="server" ReadOnly="true" Text="Read Only TextBox" />



Also you can use below attributes but it works only with IE 
contenteditable="false" Or unselectable="on"

Saturday, January 04, 2014

SharePoint Service Account Properties


  1. In Active Directory Users and Computers, view the Properties of the user account.
  2. On the Account tab, set the following Account options.
  3. Uncheck User must change password at next logon.
  4. Check the option User cannot change password.
  5. Check the option Password never expires.
  6. Click OK.


Tuesday, December 31, 2013

Grant access to all authenticated users in your domain for SharePoint


  1. Click Site Actions, and then click Site Permissions.
  2. Click Grant Permissions.
  3. In Select Users, type NT AUTHORITY\authenticated users.
NT AUTHORITY\authenticated users

Copy/Extract/Get DLL files from Global Assembly Cache (GAC)

If you need to Copy/Extract DLL files from Global Assembly Cache (GAC) under path %windir%\assembly or c:\windows\assembly


Open Run (Press Windows + R) and type %windir%\assembly\GAC_MSIL


Run

Select folder with dll name and you will find needed dll under folder named with Version__PublicKeyToken 

GAC File System

Thursday, December 26, 2013

Auto number column in GridView or DataList ASP.NET


You can do it by adding the flowing line of code on GridView ItemTemplate HTML

<%# Container.DataItemIndex + 1 %>


Example:

<asp:GridView ID="GridView1" AutoGenerateColumns="true" runat="server">
    <Columns>
        <asp:TemplateField HeaderText="Sequence">
            <ItemTemplate>

                <%# Container.DataItemIndex + 1 %>

            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>


Sign in as different user on SharePoint 2013


"Sign in as Different User" menu option is missing in SharePoint Server 2013

To work around this issue you can access your SharePoint site using below link

http://{SiteURL}/_layouts/closeConnection.aspx?loginasanotheruser=true

Note: Currently this option does not work in IE 10 and Safari.

Sunday, July 11, 2010

Execute Java Script Function After AJAX Request

The Follwing JS Code on 'endRequest' Function Will Be Execute After AJAX Request
Ex: After Submitting ASP.NET Form

function pageLoad() {
var manager = Sys.WebForms.PageRequestManager.getInstance();
manager.add_endRequest(endRequest);
}
function endRequest(sender, args) {

//Add Your JS Code Here
window.scrollTo(0, 300);
}

Check ASP.NET Page If Valid Using JavaScript

Check ASP.NET Page If Valid (All Validating Form Input Controls Are Valid) Using JavaScript

function ValidatePage() {
if (typeof(Page_ClientValidate) == 'function') {
Page_ClientValidate();
}
if (Page_IsValid) {
//Add Your JavaScript If Page Valid.
document.getElementById('divCaution').style.display = 'none';
}
else {
//Add Your JavaScript If Page Not Valid.
document.getElementById('divCaution').style.display = 'block';
}
}

Saturday, May 30, 2009

Save As Word Document Script

The following JS code will save the inner text of an element like ‹Div id="Save"›, the server must have Microsoft word installed on it and it works only on IE.

function SaveAsWord()
{
var sp = document.getElementById("Save");
var docApp = new ActiveXObject("Word.Application");
var doc = new ActiveXObject("Word.Document");
doc.Application.Visible=false;
doc.Content=sp.innerText;
// Show Save Dialog
doc.Save()
doc.Application.Quit();
}

Add To Favorites Script

function AddToFavorites()
{
var url = document.location.href;

if (window.sidebar)
{
// Mozilla Firefox
window.sidebar.addPanel(document.title, url ,"");
}
else if( window.external )
{
// IE
window.external.AddFavorite(url , document.title);
}
}

Saturday, March 21, 2009

VSeWSS 1.3 (Mar 2009 CTP)

Visual Studio 2008 extensions for Windows SharePoint Services 3.0, v1.3 - Mar 2009 CTP

The tools provide item templates for List Definition, List Definition from Content Type, Content Type, Field Control, Web Part, Module, Root File, Template, Event Receiver, and List Instance. It provides project templates for Team Site Definition, Blank Site Definition, List Definition, Web Part and Empty. It works with Visual Basic .NET and C# languages and a comprehensive user guide is included. It does not include the SharePoint Workflow templates as they are built in with Visual Studio 2008.

Sunday, March 08, 2009

Cross SharePoint Permission When Anonymouse Allowed

When Working With Anonymouse You Some Proplems in Permission The RunWithElevatedPrivileges Method Allow You to Executes a specified Code or method with Full Control rights even if the user does not otherwise have Full Control

SPSecurity.RunWithElevatedPrivileges(delegate()
{

//You Must Create SPSite Object and SPWeb Object Here

// Add Your Code Here Like Add Item to SharePoint List

});