Wednesday, May 22, 2013

Installing IIS 8 on Windows Server 2012 .

This step-by-step instruction is not unique to installing IIS.


  • Windows Server 2012 has been installed.

Installing IIS 8 with the Default Settings

To install IIS 8, use the following steps:


Open Server Manager.
Under Manage menu, select Add Roles and Features

Select Role-based or Feature-based Installation:
Select the appropriate server (local is selected by default), as shown below:

Select Web Server (IIS):

No additional features are needed for IIS, so click Next:

Click Next:

Customize your installation of IIS, or accept the default settings that have already been selected for you, and then click Next:

Click Install:

When the IIS installation completes, the wizard reflects the installation status:

Click Close to exit the wizard.

Wednesday, May 15, 2013

How to create a new Visual Web Part in SharePoint2013 .


This post is very help full for SharePoint beginners who are confused in identifying a starting point for developing SharePoint 2013 application   with Visual studio 2012.

Step1:  Open Visual Studio 2012 --> select new project under Start Tab, or from the File Menu Select New and then select Project. 

Step2: In the list of Installed templates select SharePoint and select SharePoint 2013 Empty project.

Step3: Once the Project name  entered and click the OK button , the Project creation wizard .

Step4:  You can expect your Solution Explorer to be like the one shown in picture.

Step5:  Right Click on the Project , then Select Add and click the  New Item link in the context menu.

Step6: This one invoked  Add New Item window. In the Installed Templates, select Visual Web Part  Provide a name for the Visual Web Part and click  Add button to add it to the SharePoint Project.

Monday, May 13, 2013

Cannot connect to the targeted site error in Visual Studio 2012 SharePoint Developer Tools when working with custom host headers

When I am working with the new Visual Studio 2012 RC SharePoint Developer Tools I get the ‘Cannot connect to the targeted site’ error message if I try to connect to a local site that is using a host header.

Cannot connect to the targeted site. This error can occur if the specified site is not hosted on the local system. SharePoint solutions work only with locally-installed versions of SharePoint Foundation or SharePoint Server. Remote development is supported only for apps for SharePoint 2013.

Do like this :registered the site URL in DNS (local DNS on development machine) then you’ll get this error. It seems that Visual Studio looks at the hosts file
(C:\Windows\system32\drivers\etc\hosts) for fully qualified names instead of DNS.

Once you add the site’s URL to the hosts file (either to or the local IP of the development machine) all is good and Visual Studio will connect .

Hope this one helps!

Cannot connect to the configuration database.

I am having a fresh installation of SharePoint 2013 on my machine, suddenly today I started my PC and trying to start the Central Administration then I got this error.

 “Cannot connect to the configuration database.”

So I have done below steps to resolve this issue

Step1: Go to run text box (Win + R shortcut key)

Step2: Type services.msc in the text box and press enter.

step3: You will see all the list of services running; Make sure the SQL Server (SHAREPOINT) service is started if not please start the service. (In my case it was not started)

Step4: Now try to access the SharePoint Central administration, you will able to do .

Visual Studio project templates are missing

Are you getting this error:

I Fixed it by..

Step1: Close all instance of Visual Studio

Step2:  Open Visual studio Command Prompt

Step3:  Wirte this command


then enjoy All templates

Saturday, May 11, 2013

Visual Web Part Life Cycle

SimpleVisualWebPart - OnInit

SimpleVisualWebPart - OnLoad

SimpleVisualWebPart - CreateChildControls

SimpleVisualWebPartUserControl - OnInit

SimpleVisualWebPartUserControl - OnLoad

SimpleVisualWebPartUserControl - Page_Load

SimpleVisualWebPart - OnPreRender

SimpleVisualWebPartUserControl - OnPreRender

SimpleVisualWebPart - SaveViewState

SimpleVisualWebPartUserControl - SaveViewState

SimpleVisualWebPart - Render

SimpleVisualWebPartUserControl - Render

SimpleVisualWebPart - RenderContents

SimpleVisualWebPartUserControl - OnUnload

SimpleVisualWebPartUserControl - Dispose

SimpleVisualWebPart - OnUnload

SimpleVisualWebPart - Dispose

Event Phase
Method or event to override
Initialize Initialize settings needed during the lifetime of the incoming Web request. Init event (OnInit method)
Load view state At the end of this phase, the ViewState property of a control is automatically populated. A control can override the default implementation of the LoadViewState method to customize state restoration. LoadViewState method
Load Perform actions common to all requests, such as setting up a database query. At this point, server controls in the tree are created and initialized, the state is restored, and form controls reflect client-side data. Load event
(OnLoad method)
Handle postback events Handle the client-side event that caused the postback and raise appropriate events on the server.

Note   Only controls that process postback events participate in this phase.
RaisePostBackEvent method
Prerender Perform any updates before the output is rendered. Any changes made to the state of the control in the prerender phase can be saved, while changes made in the rendering phase are lost. PreRender event
(OnPreRender method)
SaveViewState The ViewState property of a control is automatically persisted to a string object after this stage. This string object is sent to the client and back as a hidden variable. For improving efficiency, a control can override the SaveViewState method to modify the ViewState property. SaveViewState method
Render Generate output to be rendered to the client. Render method
Dispose Perform any final cleanup before the control is torn down. References to expensive resources such as database connections must be released in this phase. Dispose method
Unload Perform any final cleanup before the control is torn down. Control authors generally perform cleanup in Dispose and do not handle this event. UnLoad event (On UnLoad

You may be trying to access this site from a secured browser on the server

When you try to open a Microsoft SharePoint Server 2013 site, you receive the following error message: 
You may be trying to access this site from a secured browser on the server. Please enable scripts and reload this page. 

To do this, follow these steps: 
1.   Open Internet Explorer.

2.   Go to the SharePoint Server 2013 site.

3.   Press Alt to reveal the Menu bar and click Tools.

4.   Then click Internet Options.  

5.   On the Security tab and click Custom level.

6.   Scroll down to the Active scripting section.

7.   And then select Enable.

Friday, May 10, 2013

How do I fix the error 'Named Pipes Provider, error 40 - Could not open a connection to' SQL Server'?

If you get error 404 when you open the sql server 2012:

Step1: Run SQL Server Configuration Manager.

Step2: Go to SQL Server Network Configuration > Protocols for SQLEXPRESS.

Step3: Make sure TCP/IP is enabled.


SharePoint 2013 Installation

For SharePoint installation I have logged in with SPAdmin account, and also have created one more account for which will have administrator rights on SharePoint farm ( SPFarm).

1) Download : SharePoint Server 2013

2) Mount ISO file. and start installation process.

 Before starting installation SharePoint Server, need to install software prerequisites. So click on Install software prerequisites.

Accept and terms and licence agreement and go next.

 After the above step you can proceed with the actual installation.Once installation of Prerequisite is done. Click on Install SharePoint Server.

Enter product key and Continue.

How to Upload Multiple documents in SharePoint 2013

In SharePoint 2013 the “Upload Multiple” Options has been depreciated.There are two alternative ways to Upload multiple documents though we will discuss both in this post
Option 1 -  Using the drag-and-drop functionality

Microsoft has done an incredible job by adding this feature to the highly popular document libraries. On any document library you can now simply Drag and Drop the document and it will be upload with a quick progress bar. Here is how this feature works
Simply select multiple document from local and drag it onto the document library.The window will change to “Drop here..”

You can see the Upload documents Status bar next at the Document Libraries title.

You would see Upload Complete once the upload completes.

Know Issues with Drag and Drop -
Feature will not work with the IE version Internet Explorer version 8.0.6001.18702IC

Option 2 - Windows Explorer view
To Open Windows Explorer click on Upload Document button as shown in picture below

Next in the Add Documents popup click on “Upload Files using windows Explorer Instead”

You will Probably get the following error

To resolve this add the SharePoint site as Trusted in your Browser and Make sure that the WebClient service is running. To do this, follow these steps:

Click Start, click Run, type services.msc, and then press Enter.
In the list of services, locate the WebClient service, and then make sure that its status in the Status column is set to Started. If its status is not set to Started, double-click WebClient, click Start, and then click OK.

Once done restart the browser and try opening the Windows Explorer again. In the Windows Explorer you can copy and paste Multiple documents as done in earlier SharePoint versions.