Wednesday, April 29, 2015

How to use SPSiteDataQuery in sharepoint

Below is the example how we can use spsitedataquery in sharepoint

using (SPSite site = new SPSite(ServerText.Text))
{
    using (SPWeb web = site.OpenWeb())
    {
        // Fetch using SPSiteDataQuery
        SPSiteDataQuery query = new SPSiteDataQuery();
        query.Lists = "<Lists ServerTemplate=\"105\" />";
        query.ViewFields = "<FieldRef Name=\"Title\" />" +  /* Title is LastName column */
                "<FieldRef Name=\"FirstName\" Nullable=\"TRUE\" Type=\"Text\"/>";
        query.Webs = "<Webs Scope=\"SiteCollection\" />";

        DataTable dataTable = web.GetSiteData(query);
        dataGridView3.DataSource = dataTable;
    }
}

Thursday, April 9, 2015

SharePoint URL Shortcuts

Sandboxed Solution Gallery:
/_catalogs/solutions/Forms/AllItems.aspx

Workflow history hidden list:
/lists/Workflow History

Filter toolbar for Lists and libraries (Added by Asimaili):
?Filter=1

Site usage page (Added by @Dnyag):
/_layouts/usage.aspx

Site content and structure  page (Added by @Dnyag):
/_layouts/sitemanger.aspx

Site settings page (Added by Aowworld):
/_layouts/settings.aspx

View all site content page (Site content) (Added by Aowworld):
/_layouts/viewlsts.aspx

Manage site collection features - CASE SENSITIVE 
/_layouts/ManageFeatures.aspx?Scope=Site

Manage site features :
/_layouts/ManageFeatures.aspx

 Get the version of the SharePoint server (Patch level) :
 /_vti_pvt/Service.cnf

Web Part Maintenance Page :
?Contents=1

Show Page in Dialog View :
?isdlg=1

Application page for registering SharePoint apps :
/_layouts/15/appregnew.aspx

Save Site as a template : 
/_layouts/savetmpl.aspx

Sign in as a different user :
/_layouts/closeConnection.aspx?loginasanotheruser=true

Enable SharePoint designer :
/_layouts/SharePointDesignerSettings.aspx

Welcome Page (Default page settings) :
/_layouts/AreaWelcomePage.aspx

Change Site Master Page :
/_layouts/ChangeSiteMasterPage.aspx

Page Layouts and Site Templates :
/_Layouts/AreaTemplateSettings.aspx

Master Pages library :
/_catalogs/masterpage/Forms/AllItems.aspx

User Information List :
_catalogs/users/simple.aspx

Quick Deploy List :
Quick%20Deploy%20Items/AllItems.aspx

Open Page in Edit Mode :
?ToolPaneView=2

Taxonomy Hidden List (MMS) :
Lists/TaxonomyHiddenList/AllItems.aspx

User Information List :
_catalogs/users/simple.aspx

Force displaying the user profile in the site collection :
/_layouts/userdisp.aspx?id={UserID}&Force=True

View size of all lists and libraries :
/_layouts/storeman.aspx

Wednesday, April 1, 2015

how to get the current ui culture using CSOM

use the below line of code to get the current UI culture

_spPageContextInfo.currentCultureName