Friday, December 27, 2013

Invalid characters in SharePoint naming conventions

This article lists the characters that you cannot use in the following names in Microsoft SharePoint:Site namesFolder nameServer namesFile namesSite names, subsite names, or site group namesYou cannot use the following characters anywhere in a site name, in a subsite name, or in a site or Active Directory group name:-Tilde (~)Number sign (#)Percent (%)Ampersand (&)Asterisk (*)Braces ({ })Backslash (\)Colon (:)Angle brackets ([ ])Question mark (?)Slash (/)Plus sign (+)Pipe (|)Quotation mark (“)You cannot start a site name, a subsite name, or...

Configure SSL for SharePoint 2013

Access SharePoint site using custom ...

Friday, December 20, 2013

Generate script for ALTER DB column Data for all tables available in DB

Run Below query to generate script:SELECT'ALTER TABLE ' + TABLE_NAME + ' ALTER COLUMN Createdby varchar(50) ;' + 'ALTER TABLE ' + TABLE_NAME + ' ALTER COLUMN Updatedby varchar(50) ;' AS ScriptFROM INFORMATION_SCHEMA.TABLESTake care of following items:Above query generate scripts for all the tables which were created in that database, deleted tables are also included in it.If tables contains that field or not it will generate script for that table also. Manually you have to remove that table script to run the generated scripts.CreatedBy and UpdatedBy...

Thursday, December 5, 2013

How to change Default Home Page : SharePoint

I frequently get questions on changing the home page or using another page as the home page: Can I have three (or four or five or…) columns in the default home page? Do I have to use the new wiki home page in my Team Site? I want to test a new home page design, but I don’t want to lose the existing home page… (just in case you know…) How can I use a page from my wiki library as my home page?Below are four ways to set another page as your home page:...

Tuesday, October 8, 2013

How to Close Model Dialog on Button Click

 <asp:Button Text="Close" runat="server" ID="btnClose"          OnClientClick="javascript:window.frameElement.commitPopup();" /&...

Thursday, September 12, 2013

Configure RDLC Report with ReportViewer : SharePoint 2010

I have worked with SharePoint 2010 Foundation and found the RDL(C) report is not configured automatically.  To run a successfully report I applied the following changes in SharePoint web.config file. To make sure the configuration works for reporting just put a reportviewer control inside a webpart/page and try to access the page. First of all make sure you have intalled “Microsoft Report Viewer 2010 Redistributable Package”. You can it from...

Friday, September 6, 2013

How to call Server Side Method from jQuery/javascript using Ajax & JSON Parsing

With this post I would show how to call server side method from client side. Here I use jQuery to utilize the Ajax Capabilities which will help us to get/post data to/from server Asynchronously. There are many methods available to perform an async callback to the server. Here I will show a simple example as in how to call a code behind Webmethod.For simplicity I would be calling the code behind method on a Button Click. Here is the code:<asp:Button ID="Button1" runat="server" Text="Click" /><br /><br /><div id="myDiv"></div>JQuery/JavaScript...

Tuesday, August 27, 2013

Session state has been disabled for ASP.NET. The Report Viewer control requires that session state be enabled in local mode

Solution for following error:I had to install SharePoint Foundation 2010 for a new project. They needed a native Web Part, and the name of this was Report Viewer controlBut a received a strange correlation-ID error and I could not open anymore my site. so I opened ULSVIEWER and got a stranger error: Session state has been disabled for ASP.NET. The Report Viewer control requires that session state be enabled in local modeSo I made...

Monday, July 8, 2013

How to send requrest after executing Response.End() statement

Once I have to create a custom search on list item for some of the item fields and then it can be exported to excel. I successfully developed a custom visual web part which display only those record which fulfilling the search criteria and is transferred to excel. But then i face one problem that first time when i search the record and export it to excel it works fine. But for the second time my request is not sent to server because of using Response.End() function to avail the user to download the exported record in excel file.So following is...

Monday, July 1, 2013

How to decrease Content DB Size

If your content DB size is more than its actual size then you have to remove items from your Recycle Bin.Once you remove your item from Site Action -> Recycle Bin it will transffered to Admin Recycle bin. You have to remove it from there also.http://yoursite/_layouts/AdminRecycleBin.aspx?View=2Once you removed your data from here now see the size of your content db. Its reduced now.Than...

Friday, June 28, 2013

How to Display SharePoint Control in Display Mode in List Edit Page

I am facing the problem in which I need to display the SharePoint List Field in "Display" mode in List Edit Page. (This Problem works with SharePoint Default generated Page)Step-1 : First of all please download the JavaScript file from here.Step-2 : Add this JavaScript file in your project StyleLibrary.Step-3 : Now Open your List Default Edit Page.Step-4 : Find PlaceHolderMain tag. and after this tag insert you desired code as below:<script type=text/javascript>function...

Wednesday, June 19, 2013

Custom Code for send Mail in SharePoint using C# .net code

Create new project in Visural Studio create new Project by following the below step:File -> New -> Project -> Visual C# -> Windows in Installed Template -> Select Console Application. Give your desire name to the application.Add Following Reference in your code:Microsoft.SharePointAdd Following Name Space in you code:using Microsoft.SharePoint;using System.Net.Mail;Replace Program.cs code with below code:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Net.Mail;using Microsoft.SharePoint.Administration;namespace...

How to check current user in particular group in JavaScript using SPServices

Add two JavaScript file in your Style Library.1. Javascript 1.7.1.js (Download from here)2. jquery.SPServices-0.7.1a.min.js (Download from here)<script type="text/javascript" src="/Style%20Library/js/jquery-1.7.1.min.js"></script><script type="text/javascript" src="/Style%20Library/js/jquery.SPServices-0.7.1a.min.js"></script><script language="javascript" type="text/javascript">$(document).ready(function () {                $().SPServices({           ...

Tuesday, June 18, 2013

Using PowerShell to deploy SharePoint Solutions and Features

The STSADM command line application worked well with previous versions of SharePoint. But the world is progressing and PowerShell will be the new administrative tool for SharePoint. In previous articles, I already showed some amazing powerful scripts that otherwise would require more lines of code. PowerShell offers some great advantages in large farms, as they can be run remotely on target machines, can be signed and therefore be controlled. Building up a repository of scripts or cmdlets to execute common tasks would be worthwhile in the long...

Friday, June 14, 2013

How to access user profile in Windows SharePoint Services + jquery

How to retrieve the SharePoint User profile in jQuery with use of SPServices.Use below function for fetching the user information in jquery.function getUserInfo(UserId){wsBaseUrl = '/_vti_bin/';var uiObj = {};if(typeof(UserId)=="undefined" || UserId=='')UserId = _spUserId;var arrOfFields = ['ID', 'Name', 'Title', 'EMail', 'Department', 'JobTitle', 'Notes', 'Picture','IsSiteAdmin', 'Created', 'Author', 'Modified', 'Editor', 'SipAddress', 'Deleted'];var item = getItemById('UserInfo',UserId,arrOfFields);    if(item != null){  ...

Tuesday, June 11, 2013

The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)

This problem is caused when another application runs on default port i.e. :80.Most probably this issue occur because of Skype.You can find the application which is running on that particular port by following command:Open command prompt as administrator mode and type following command:netstat -anoThis command list the process running on particular port. Please close that application and start your website from iis manager.Now, You can able to access it as previous...

Monday, May 27, 2013

How To Set File Uplod Limit In SharePoint2010

By Default SharePoint2010 provides 50MB files to be upload to the server. If you want to extend upload size to server then you can do it in two ways. Through Central Admin: Navigate Central Admin -> Application Management -> Manage Web Application -> Select your web application -> General Setting. It contains Maximum Upload Size. Configure this to set maximum upload file limit. But you have to take care about the maxAllowedContentLength and maxRequestLength from the web.config file. To update web.config its very harmful if any other...

Saturday, May 25, 2013

Create New Site Collection in the New Content Database in SharePoint2010

If you want to create a new site collection in the specific database, there are several different options available in the SharePoint 2010.From the central administration site, you can create the site collection in the specific database with the following workaround. The downside of this approach is you have to temporarily take down the all the content databases in the given web application except the database where you want to create the new site collection. Create a new content database for the given web application (Central Administration ->...

Friday, May 24, 2013

Add Custom File Attachment Control in the Form of SharePoint

Normally SharePoint provides Document Attachment in the ribbon. But in my case ribbon was hide from the user. So I need to add Attachment Control on the form instead of ribbon. So I achieve it using Client Object Model. Insert the following code in your form to make attachment field available in the Form.<tr> <td rowspan="2" width="190px" valign="top" height="50px">        <H3>             Upload Evidence       ...

Thursday, May 23, 2013

How Value Return in Before Properties, After Properties and ListItem using EventReceiver in SharePoint2010

Event receivers are common in SharePoint development so its better to understand the data available in each events. Sometimes as a developer we jump into coding before thinking about contextual data availability.One more important thing to notice list event receiver  and document library event receiver are different items of contextual data availability.Following Table will give you a clear picture about the contextual data in each events. SharePoint ListEventBefore Properties ReturnsAfter Properties ReturnsListItem ReturnsEvent TypeItem...

Get Field Values in ItemDeleting Event in SharePoint 2010

If you want to get value from a field in ItemDeleting event, you will need to call SPEventProperties.ListItem[“FIELD_NAME”].ToString() method. If you try to get a field value using AfterProperties or BeforeProperties properties, you will get System.NullReferenceException. The reason is these properties are only accessible in ItemUpdating or ItemUpdated events. An example of ItemDeleting event receiver is provider below:try{ string fieldValue = ""; fieldValue = properties.ListItem["FIELD_ID"].ToString();}catch (Exception ex){ properties.Cancel...

Synchronous and Asynchronous Event Handlers

In SharePoint 2010 it is possible to handle events that occur on list items. These types of events come in two types: Synchronous and Asynchronous Event. Synchronous: happens 'before' the actual event, you have the HttpContext and you can show an error message in the browser and cancel the event Asynchronous: happens 'after' the actual event, there's no HttpContext  and you cannot directly show an error message or cancel the eventBy sub-classing Microsoft.SharePoint.SPItemEventReceiver you can override the desired "event" methods. Synchronous:...

Friday, May 17, 2013

How to check member is exist in specific group in SharePoint2010 using javascript

In SharePoint 2010, if you want to check logged in user exists which particular group using javascript as follow:function IsGroupMember(GroupName){     var isGroupMember = false;     $().SPServices(     {          operation: "GetGroupCollectionFromUser",          userLoginName: $().SPServices.SPGetCurrentUser(),          async: false,completefunc: function(xData, Status)      ...

How to hide fields based in selection of radio button using java script

SharePoint generates a HTML code for the New/Edit/Display Page for each created list.Now you have to the following java script code in your desire page to hide the fieldAssume the html code is as follow:<input type="radio" name="Internal Person" id="Person Type" value="ctl001">Internal Person</input> <input type="radio" name="External Person" id="Person Type" value="ctl002" >Invoiced</input>The above code displays 2 radio button. Now you want to hide var newVal = $(':radio[name=Reported By]:checked').val();if (newVal ==...

Friday, May 3, 2013

Getting error while creating a new web app saying "The password supplied with the domainname\username was not correct. Verify that it was entered correctly and try again"

When you create new web application at that time you enter your credential as the system account of the particular Web Application.After that when you update your credential at that time you must have to update your credential in SharePoint also because SharePoint store your credential in SharePoint database.To update your credential in SharePoint Database you must have to pass follow command in command prompt:** Please open command prompt in Administrator mode. cd "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN"...

Wednesday, May 1, 2013

Make Windows 8 Boot Directly To Desktop

Would you prefer to have Windows 8 bypass the Start Screen and boot straight to the desktop? If so, you can do so using a technique that takes advantage of a feature that is built right into the operating system - no third-party tools required. All you have to do is create a specially configured task that is scheduled to run at log on.In this post, I’ll walk you through the steps required to make Windows 8 boot straight to the desktop using a specially...

Wednesday, April 24, 2013

First 9 things required to set as default setting in MS Word 2013

Everyone wants to work with latest software and make themselves upgraded with latest functionality. MS Office came up with 2013 version and it requires some default setting to make your document unchanged in other office version. Now, the changes I make may not make sense for you and I am not suggesting that everyone do exactly what I do, but I am suggesting that you take a few minutes to adjust the default settings in MS Word 2013 to make it...