Wednesday, November 11, 2009

SharePoint FBA “No exact match was found” error

If you are configuring FBA for SharePoint and, at a certain point, while trying to add a database user or role to SharePoint you get the “No exact match was found” error, the answer is one of the following 2:

1. the Central Administration App Pool account does not have sufficient rights on your SQL aspnetdb database
2. something is not configured properly in one of your web.config files you just modified

As option No 1 is the easiest and quickest to check, I’d start with that one.

Posted by Madalina at 11:53:18 | Permalink | No Comments »

Monday, August 31, 2009

SharePoint ActiveX controls background color

Problem: a SharePoint skin with a dark background color. All the ActiveX controls (multiple file upload, Datasheet view) inherit the background color.

Solution: to keep the background you want, but not affect the ActiveX controls, include this fix:

body
{
background-color: white;
}
form#aspnetForm
{
background-color:#YOUR_DARK_COLOR#;
height:100%;
}

I found this extremely useful tip here.

Posted by Madalina at 18:17:22 | Permalink | No Comments »

SharePoint related jokes

To laugh at oneself is a good thing, that only intelligent people can do. As SharePoint developers, we are proud to also be able to laugh at our behavior, geekines and well… lives :) Here is one of the 40 jokes that Paul Swider gathered on his blog:

Q: How many SharePoint consultants does it take screw in a light bulb?
A: 100. 1 to do, 99 to say they could do it better.

Posted by Madalina at 18:07:45 | Permalink | No Comments »

Wednesday, August 5, 2009

SharePoint 2010 Sneak Peak

If you wonder how SharePoint 2010 is like, Microsoft has given you the opportunity to have (some of) your questions answered. A sneak peak is available, through a presentation of the features that SharePoint 2010 together with Visual Studio 2010 and LINQ offer for SharePoint development.
  
The information is structured in 3 categories - Overview, IT Professional and Developer - so that you can choose what you want/need to know.

  

Posted by Madalina at 14:55:40 | Permalink | No Comments »

Tuesday, June 16, 2009

Vocalizing SharePoint errors

Just like any one of us, SharePoint also has the need to vocalize its complaints, requests and dreams… and, of course, errors.
By default, when an error occurrs in Sharepoint, we are presented with this pretty picture:
 

 
Not very vocal.
 
To let SharePoint share the real reason behind the error with us, we need to edit the web.config of the web application twice:
1. CallStack=”true”
2. customErrors mode=”Off”
  
After an IIS reset and a refresh of the error page, here is the result:
 

 
Much better, isn’t it? :)
   
Posted by Madalina at 16:17:59 | Permalink | Comments (1) »

Friday, April 3, 2009

SharePoint Designer 2007 Free!

For a while now there has been talk that starting April 1st, SPD would be free to download. Everyone took it as an April Fool’s Day joke, but it is true! Starting this April, SPD 2007 is free to download on the Microsoft site. 
 
Is it because so many people are now using it, or maybe because a new an improved version is on its way? :)

 
Posted by Madalina at 07:37:00 | Permalink | No Comments »

Monday, March 9, 2009

Enabling Silverlight 2 in SharePoint / The easiest sample

Silverlight promises to give SharePoint exactly what it doesn’t have: glam :).
SharePoint is a very powerful tool, but it comes a time in the life of such a powerful tool when it needs a little dosage of eye-candy design. Right now, that can be very easily achieved with Silverlight.
As the two are siblings of the same technology (plain old ASP .NET :) ) they work very nicely together.
But first of all, some SharePoint configuration element are needed.

Configure SharePoint to run Silverlight

The needed configuration elements are:
1.
Silverlight 2 plug-in.
2. .NET 3.5 framework installed on the server.
3. Service Pack 1 installed for WSS 3.0/MOSS 2007.
4. System.Web.Silverlight.dll added in the Global Assembly Cache (GAC).
5. New 
Web.config elements in the web.config of the Web application you are planning to run Silverlight on.
6. The .xap extension registered as a MIME type (application/x-silverlight-app) in IIS.
7. [Development requirements:
Silverlight Tools for Visual Studio 2008 SP1, Install Microsoft Expression Blend 2 and Microsoft Expression Blend 2 Service Pack 1]

Easiest test - Silverlight on SharePoint

To test if Silverlight actually works, open a site in the web application that you configured to run Silverlight controls (point 5 above).
Silverlight can easily be added in a Content Editor Web Part. For that, you will need, first of all, a Silverlight control to add. You can find a simple Silverlight control on the Internet, or
here.

1. Create a document library in the site you just opened. I named mine XAPS.
2. Navigate to this library and upload the Silverlight control.
3. On the site Home page (for example) add a new Content Editor Web Part.
4. Open the Edit panel and select Source Editor.
5. In the content text box enter the following:

<object width=”100%” height=”200″
    data=”data:application/x-silverlight-2″
    type=”application/x-silverlight-2″ >
    <param name=”source” value=”/xaps/SilverlightControl1.xap”/>
</object>

6. Click Save and then OK and the Web Part should load the following:

A very good place to start with Silverlight and SharePoint is CodePlex’s Silverlight Blueprint for SharePoint.
 

Posted by Madalina at 10:26:49 | Permalink | No Comments »

Monday, January 19, 2009

AlternateCssUrl - what is it useful for?

When you design a SharePoint MasterPage or Theme, you usually include the CSS style sheet references in the .master file or in the Theme folder. And those style sheets contain all the styling you need.

If you work with a masterpage, you will probably set in code values for DefaultMasterPageURL and CustomMasterPageURL.

There is one more property of a SharePoint site called AlternateCssUrl. You would use this property if you don’t want to create a MasterPage or a Theme, but just apply a skin on the SharePoint default look - by specifying a value for this property, you make SharePoint include your style sheet in its pages.
 
Although it would look like the AlernateCssUrl property has a very limited use, you could not be more mistaken. There are pages in SharePoint that do not implement any masterpage - not the default.master, not the application.master. One example is the Picture Slideshow page.

This is the case where the AlternateCssUrl property comes in handy - by initializing this property value with your custom css style sheet, you can rest assured that all the SharePoint pages in a site will be skinned.
 

Posted by Madalina at 17:33:51 | Permalink | No Comments »

Wednesday, January 7, 2009

SharePoint System MasterPage - hide the Search control or delete it?

It is a known fact that SharePoint can skin its system pages.
When designing a system masterpage for SharePoint, there are 2 ways that you can follow: take the generic application.master and customize it, or start from the existing masterpage of the site, supposing you are working on a skinned site.

I usually start from the main masterpage of the site and take into account the fact that the system masterpage needs a few tweaks.
The 3 main differences between the regular site pages and system pages in SharePoint are:
1. The Search control is missing on the system pages.
2. The Breadcrumb is different on the system pages.
3. The left navigation placeholder is empty.

Letting the Breadcrumb tweak for you to discover :), I will make you now aware of the fact that the Search control is not needed on the system pages master.
When you don’t want use certain controls (ContentPlaceHolders) on a SharePoint masterpage, you generally choose to hide them, not delete them, by placing them in a hidden panel. SharePoint will still find them and so not retrieve an error, but they will not show up in the page design, giving the site the look of your choice.
Following this pattern, I first hid the Search control on the system page in a panel. Everything worked fine until I tried to Check In/ Check Out a file and i got this error:
“Unable to validate data. at System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) “

This error did not appear when the site was skinned with the SharePoint Default theme. So the problem laid in the customized application.master file. The only difference between the application.master and my system.master pages was that in my master I had the Search control place holder hidden (but present).
After deleting it, everything worked fine. Except… WIki Sites - History of a page retrieved an error: “Search PlaceHolder not found”.

So the answer to the question in the title is - Delete the Search control, leave the PlaceHolder:
< asp:ContentPlaceHolder id=”PlaceHolderSearchArea” runat=”server” >
< / asp:ContentPlaceHolder >
  

Posted by Madalina at 18:00:00 | Permalink | Comments (2)

Thursday, November 27, 2008

SharePoint Breadcrumb - fit it in the design as a unitary control

When a designer creates a mockup for a SharePoint site, (s)he almost never includes the breadcrumb(s). In my experience, that is not a very good option - as the breadcrumbs are vital to the navigation, especially if the site top navigation is not inherited in the subsites.
There are 2 breadcrumb controls in a site: the one on the top of the page, that maps from the root site down to the current site and the breadcrumb below the top navigation, that maps the current site.
 

 
Generally, if I am going to include them in the design, I prefer to have them both in one place. But as you can see, the last node of the first breadcrumb is the first node of the second. So just placing them one after the other won’t do - one node will repeat itself in the middle of the breadcrumb.
There is a simple solution to that. The Breadcrumb control allows for a separate css class dedicated to its root node. 
So going in the master page html code and setting a value for that attribute of the second breadcrumb is the first step. Name it as you like.
The second step is to define that class in the styling css file. The ‘display’ attribute with the ‘none’ value will do the trick. You have just hidden the root node of the second breadcrumb.
This way, you can list the two breadcrumbs and make it look like you only have one breadcrumb.
 
Posted by Madalina at 08:12:36 | Permalink | No Comments »