Skip to main content

Posts

Showing posts with the label Moss2010

SharePoint Branding Solution Pack using VS2010

Introduction Today, in this blog I am trying to provide you the Custom Branding solution Pack. This solution pack will save time and effort while developing the custom sharepoint with publishing sites in sharepoint. It works great. So, we all are good to go and use this re-usable solution pack. Description The source code shows how to prepare a structure for Sharepoint Branding solution. This pack contains : Master Page Gallery structure Page Layout Gallery structure Image Gallery Styles Library gallery Event Receiver

Consistent SharePoint 2010 branding for Mobile browsers

Through this article I am going demonstrate you how to make consistent UI in sharepoint2010 in different mobile browsers. My mates every time asking me why we need to involve mobile device with SharePoint. Through this article I am just giving the sample where I am showing why we are slowly moving to mobiles from PC. While giving demo on "SharePoint on mobile" to client I found below things: Client want everything on their hand, means on mobile (Bcoz of busy schedule no time to open laptop/system) Client doesn't want to compromise with UI. Application should as simple and easy to use. Application should be scalable and easy to extend in future. Out of all four, below three is already provided by SharePoint. SharePoint is lacking somewhat in First point.  But as I said we developer can do anything so here we can do the same "We will bind the SharePoint without breaking SharePoint Rules". I am using safari browser for the demonstration because thro...

Create Custom hit counter in SharePoint2010 using Sandbox Solution

In this blog I am going to demonstrate how to create Hit counter for SharePoint site with user details using sandbox solution. I took reference from codeplex code( http://hitcounter.codeplex.com ) which is sharepoint2007. I modified his sample and tried make it simple and easy for you. Once you understand the way I created then its very simple for you to make any further modification depends on your requirement. This solution will be very useful when you need detail about the person who visit this page and also about the number of time page view with page detail. I created this solution that will make your work easy. It's very simple where you don't need to do anything except deploying the feature and adding the web part into you master page or layout page in sharepoint2010. Below is the screenshot that will display the how it looks like:

How to create Sandbox solution with full trust Proxy

Download Files: CustomSBFullTrust.zip In this article I am explaining the step by step procedure to create a sandbox solution with full trust proxy. Before starting I am assuming you are aware of the sandbox limitations. Full trust solution is providing sandbox solution to work in a full environment. In short this is the way to achieve farm based solution functionality in a Sandbox. Namespace Required: using Microsoft.SharePoint.UserCode; using Microsoft.SharePoint.Security; using System.Security.Permissions; using Microsoft.SharePoint; using Microsoft.SharePoint.Publishing;

SharePoint Language translator web part using Sandbox

Download Files: Ravishankar.TranslatorWebPart.zip In this article we will see how to create a language translator webpart using sandbox. If you read my previous articles on language translator then it will be easy for you to understand. Before writing this article I also searched much but I didn't find a solution/web part that explains the procedure for creating a language translator in sandbox solution. As we know the limitation of a sandbox so you fill find very rare article on Language translation using sandbox web part.

How to create Publishing Page based on page layout in sharepoint2010

Hi Friends, This blog will help you when you need to create pages in based on page layout.You just need to use the below common method. private void CreatePublishingPage(string absoulteUrl, string pageName, string pageLayoutName, bool isLandingPage) { using (SPSite Osite = new SPSite(absoulteUrl)) { using (SPWeb oWeb = Osite.OpenWeb()) { string fullPageUrl = string.Empty; PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(oWeb); /* Get the publishing web page collection list. */ PublishingPageCollection publishingPageCollection = publishingWeb.GetPublishingPages(); //GetPageLayoutName(application); if (!string.IsNullOrEmpty(pageLayoutName)) { /* Search for the page layout for creating the new page */ List layouts = new List (publishingWeb.GetAvailablePageLayouts()); PageLayout pageLayout = layouts.Find( delegate(PageLayout l) { return l.Name.Equals(pageLayoutName, StringComparison.CurrentCultureIgnoreCase); }); /*page layout exists*/ if (pageLayout ...

Programmatically create web part for mobile in SharePoint2010

In SharePoint 2010 all mobile devices are redirected by default to the mobile SharePoint rendering engine. The mobile rendering engine of SharePoint provides mobile users access to the sites with a completely stripped interface. Its main function is to list all libraries and to provide basic access to them. 1. Create a Visual Studio 2010 Visual Web Part Project

Create Personalize Application toolbar in SharePoint 2010

In this article I am going to explain about the application toolbar which will display the applications based on the current login users. To achieve the requirement we need to create two custom lists i.e. "All Apps" and "User App" " All Apps" list will have the below columns: " User Apps " list will have the below columns:

Custom Sandbox Application Page in SharePoint2010

From my previous article for " Reference web part in SharePoint 2010 ", I am extending the same sandbox solution with this article. So you just need to download code for sandbox web part and follow the steps below. The Sandbox in SharePoint 2010 allows Site Collection administrators to upload solutions in their Site Collections without access to the physical server. Sandbox Solutions do have some limitations, for instance we cannot add new application pages. Application pages are normally pages added to the _layouts folder, which are located in the 14 hive\TEMPLATE\LAYOUTS physical folder on each server. Sandboxed solutions still allows us to upload Content Pages; that is pages that are located in a document library for instance. The following are the steps to create a custom page in sandbox solution. 1. Create a project

Reference webpart in SharePoint 2010

In this article I am just going to explain how to create a reference webpart programmatically. Requirement: Need a webpart that display all pages title with link. Only related page should display in the link. Webpart should be added in all pages. Same page should not have hyperlink. In other words the query will return the page where the webpart is present. But it should have Hyperlink only with other pages. Namespaces : using Microsoft.SharePoint; using Microsoft.SharePoint.WebControls; using System.Text.RegularExpressions; using System.Text; Logic: using (SPSite site = SPContext.Current.Site)             {                              using (SPWeb web = site.OpenWeb())                 {      ...

Form Based Authentication in MOSS2010 Against SQL Server Database

Configuration: Step by step screenshot for FBA implementation In SQL: Create one web application for membership: Create Web Application(example moss:1111 and extend this application to http:// moss:1112 for From-based authentication) Changes in Web.config

How to use Mobile Entree Excel Addin in SharePoint 2010

Description : In this article I will just explain how to use Mobile Entree Excel Addin (SharePoint BI)  in SharePoint 2010 with sample example. Install Excel Add : To install the Excel AddIn go to the site, click on Mobile Entree Configuration->Global Config Excel Addin : After installation of Mobile Entree AddIn, we will get an option in Excel under "Insert" section named "Mobile View Configuration". This AddIn will help you to set a view when we open Excel in a mobile browser. Following are the steps for creating Mobile view in Excel: Step 1 . Create New DashBoard. Give it a name such as "My Dashboard".

Programmatically create custom role in selected sub sites in SharePoint 2010

In this article I am explaining how to create a custom role in SharePoint using C#. A custom role is required in SharePoint when you need to assign a role to the user as per the requirement not the OOTB. Add this code to your solution to add the custom role based on the sub site. I have the following scenrio: Person: People picker that will be used to add a user. Country: Listbox containing the list of subsites where we will add the user and assign roles. Administrator type: Type of custom role where we will assign to the selected user in selected susbsite (Country). Code : private void AddUserToGroup(string selectedUser, string userGroupName,string subSite) { SPSecurity.RunWithElevatedPrivileges(delegate { using (SPSite spSite = new SPSite(SPContext.Current.Site.Url)) { using (SPWeb spWeb = spSite.AllWebs[subSite { try { spWeb.AllowUnsafeUpdates = true; SPUser spUser = spWeb.EnsureUser(selectedUser); spWeb.RoleDefinitions.BreakInheritance(true, true); SPRoleDefinition role; switch(use...

Steps for enabling archival policies in Form library

1. Open the form library, Go to Settings-> Form Library Settings 2. Click on Workflow settings->Add workflow

Display SharePoint Users, Groups and Sites in a GridView and Use a DropDownList to filter the values

This article will explain how to display SharePoint Users, Groups and Sites in a Gridview and use a DropDownList to filter the values. Step 1 : Open the Visual Studio and create a new project; select visual webpart (I am giving an example using a visual webpart). Step 2: Add the GridView to your user control, e.g. <asp:GridView ID="gvLists" runat="server" AutoGenerateColumns="False" CellPadding="4" EnableModelValidation="True" ForeColor="#333333" GridLines="None" OnRowCommand="gvLists_RowCommand"> <AlternatingRowStyle BackColor="White" ForeColor="#284775" /> <Columns> <asp:TemplateField HeaderText="Select"> <ItemTemplate> <asp:CheckBox ID="chk_Selected" runat="server" Style="position: static" />

How to get current Pages details in SharePoint2010 publishing site

Hi friends, Through this blog I just want to share my experince that how to recognize your current page or can get page detail for your current from sharepoint page library. You need to use the below code: char[] delimiters = new char[] { '\\', '?' }; string s = Page.Request.Path.ToString(); string[] words = s.Split(delimiters, StringSplitOptions.RemoveEmptyEntries); int i = words[0].IndexOf("Pages/");

Powershell magic in wsp deployment

Hi, In this post I just want to explain how to write a powershell script when you have multiple wsp’s in file location and you need to deploy in one shot. Follow the steps to achieve this : 1.Open the Notepad,Write the code below, 2.Save the file with some name and having extension “.ps1”(e.g installer.ps1).