Creating PopUp dialog boxes in SharePoint 2010

You wonder how to create pop up dialog boxes in SharePoint 2010? If you have a page of yours and you don’t want the user to navigate to another page to see it. You only need an anchor to be able to do so. just write this line of code in your page:

<a href=”javascript:OpenPopUpPage(‘http://…….’)” mce_href=”javascript:OpenPopUpPage(‘http://…….’)”> Open PopUp </a>

This will open your page without navigating away from the page you are on.

Add WebPart to your master page?

We know that webparts in the master page are not configurable, unless you configure them in SharePoint designer. If you edit the page, it won’t be editable. and we hear about putting a webpart inside the master page so it appears everywhere. Or maybe your manager told you to put the webpart inside of each page layout that’s developed by another developer. But how to achieve this?

Let’s first add our custom webpart to a webpart page stored in the pages library (or any other library but it makes sense to put it in pages library).  Name it fortest (name doesn’t matter because you won’t be using it anymore after you finish this process).

Now you have a webpart page, add your custom webpart to this page.

Now you’ll have to play with SharePoint designer to put this webpart inside your master page.

Open up SharePoint designer, and navigate to your webpart page. You can see it by clicking All files from the left pane, then you’ll find your pages library in the right pane, click it and then double click on the fortest.aspx to edit the page. It will display something like this:


You’ll find a registry entry at the beginning of your code, copy it and save it in a text editor. Then scroll down to your webpar, it will be something beginning with <WpNs0:Testwebpart runat=”server” ID=”

Copy it and save it in the text editor.

Now delete the webpart page, we don’t need it anymore. And open your master page. At the beginning of the master page, paste the registry entry that you copied from your webpart page below the other registry entries. now we’re done from the first part. To the second part, paste what you copied from the webpart page which represents the webpart itself which begins with  <WpNs0:Testwebpart runat=”server” ID=”… at whatever place you want it to  appear inside your master page. You can paste it below the footer or wherever you want.

To sum it up: you need to add your webpart to a webpart page, and then copy 2 entries from it, the registry entry which registers the webpart in the page, and the webpart entry itself.

Port Restricted For Security Reasons

Sometimes when working on your development machine and using firefox, you may get the error:


this is because firefox may block some ports by default, such as 530, 531, 540, so what would you do? remove your web application and make it on another port? well, no! you can easily unblock firefox port as follows:

Type the following in the address bar in firefox:  

about:config , you will be presented with security message telling you that changes may affect performance and security, click the button to continue.

Now right click on anywhere in the list, and choose NEW>> STRING, a window will open to enter the name for this record, type :

 now you will be presented with another window, enter the value for the port you want to unblock, such as 530. and hit OK.

 close your browser and go back to your SharePoint site and enjoy.

Master Page Editing Has Been Disabled.. Error

You may have faced this message when you tried to edit a SharePoint 2010 site’s master page:


Master page editing has been disabled for this site. Contact the site collection administrator to request permission.



This is caused in 2 cases: first case if the site collection administrator has stopped the permission to edit the master pages for the site collection, so if you are a site collection administator go to site settings, and under site collection administration you can see the button “sharepoint designer settings”, make sure that customizing master pages is enabled, if its disabled and you can’t do something about it, then this is case 2 : it’s disabled from the web application itself, so now you have to go to your web application settings using central administration tool, and on the general application settings tab, choose sharepoint designer settings, and enable the same option.


Note: Site owners can’t edit master pages unless site collection admin allow the feature, and site collection admins can’t allow it unless farm admin allow it at the web application itself.


How to use Developer Dashboard

all of us know the usage and benefits we get using Developer Dashboard in SharePoint 2010. But This Dashboard is not enabled by default in SharePoint. You (The SharePoint Administrator) can enable it using either STSADM or the SharePoint Management Shell.

Here, you will see how to enable Developer Dashboard using PowerShell, and the options you get for the Dashboard mode.

Start by opening SharePoint Management Shell, you can find this by going to Start>>All Programs>>Microsoft SharePoint 2010 Products >> Right click the SharePoint 2010 Management Shell and choose Run as administrator.

You need to know that there are 3 modes for the Dashboard, which are On,Off, and OnDemand.

These modes explain themselves. On Mode enables the Dashboard so the Site Collection Administrator will view it whenever he opens the page, he doesn’t have the option to turn it off. The Off mode Disables the Dashboard on all pages and the Site Collection Administrator has no option to get it on. The OnDemand option makes it possible for the Administrator to turn it on or off when required.

How to use Managed Metadata Service Application

In this walkthrough, I am going to show you how to configure the Managed Metadata Service Application and use it to make custom column and examine the filtering options in SharePoint 2010.

 When configuring Managed Metadata Service Application, you can add Managed Metadata Columns to your libraries and lists in the site collections which consume the Service Application Services. To understand the managed metadata service application you need to be familiar with the term store. The term store is where you make groups for your terms which are managed by term sets. Take a look at the picture below:

This is the term store management tool. Suppose you want to make a term set for countries so you can use it in lists. on the left side click your service Application Name and choose New Group


 This group will be a location for storing term sets like countries. Here i named the group “my first group”.

Click on the group and choose New Term Set, name it countries. here you will add the countries you want to appear in the suggestions in your managed metadata column.

In the same way, add two countries now for testing purposes by clicking “Create Term” from the options at the term set.

Go Back to the term set and View its option on the right as shown below:

 There are 2 important options here, the submission policy, and the Available for Tagging option. The submission policy has 2 options, closed and open. If open, it allows users to add their own terms to the term set whereas closed prevents users from adding more terms and limits them to just use what’s available.

The Available for Tagging takes the term set offline and doesn’t show the terms for users. lets keep it as it is now.

So lets go to a Site Collection that consumes this Service Application and Create a new list and add a custom column of type “managed metadata” to see what it provides.

I made a Custom list named Products and added a column named “Source Country” of type managed metadata. when creating the column note that in the term set settings.

You need to choose the service application you will use in case there is more than one service application, you will see the groups you made, and the term set, click on the countries option and click OK.

Click add new item, let’s put polo shirts in the title field and type U letter in the source country column. Notice you’ll be given the option to choose UAE. Try clicking the button at the right of the column , you will see something like this:

An important note is that if you enabled the submission policy in the term store management tool, you will see an option here to add new term to this term set, but because we chose to not enable it, no link is available now.

let’s add another 2 products for UAE and 2 for Jordan. as in the picture below:

So let’s examine the filtering and navigation settings in SharePoint using this column. click on the arrow next to the column name and choose a country:

The list will be filtered to show the desired results. this option is known in SharePoint 2007 too, so let’s try something different.

Click the list tab, and then list settings. Choose Metadata Navigation Settings

 Now choose the source country in both options (Don’t be in a hurry, You will understand now what they do). and click ok and get back to the list. See the below image

Now look at the left of your page as shown in the pic below


From the first option you can choose the column (source country) that  you have selected in the metadata navigation settings in the hierarchy options(this was the first option in metadata navigation settings) Now you can filter using this option, or if you look at the option below it and filter using key filters which retrieves the data as the source country column you made.(this was the second option in metada navigation settings)