Where have my Create options gone?

August 11, 2010

When trying to add a list or a library to a SharePoint 2007 site my only options on the Create page are to create Web Pages.

I needed to turn on the Team Collaboration Lists feature first for the site and my Create options expand to include Libraries, custom lists etc.


Telerik RadGrid not using AJAX in SharePoint Application Page

October 15, 2009

I have a SharePoint application page (A page that resides in _layouts and inherits from Microsoft.SharePoint.WebControls.LayoutsPageBase) Where I have a Telerik RadGrid. I have Ajaxified the grid by using a Telerik RadAjaxManager however whenever I filter or page the grid it performs a full page postback rather than an ajax callback. 

I managed to get this working by following the instructions here:
http://www.telerik.com/community/forums/aspnet/ajax/radajaxmanager-sharepoint-2007-bug.aspx#605189

It appears it is the UpdatePanel functionality of AJAX that doesn’t play out of the box with WSS:

Windows SharePoint Services JavaScript has a “form onSubmit wrapper” which is used to override the default form action. This work is put in place to ensure that certain types of URLs, which may contain double byte characters, will fully work across most postback and asynchronous callback scenarios. However, if your scenarios do not involve double byte character URLs, you may successful disable this workaround and gain the ability to use ASP.NET AJAX UpdatePanels.

 taken from http://blogs.msdn.com/sharepoint/archive/2007/03/02/integrating-asp-net-ajax-with-sharepoint.aspx

So the code I have added to my SharePoint Application Page is:

protected override void CreateChildControls()
{
      base.CreateChildControls();
      this.EnsureUpdatePanelFixups();
}

private void EnsureUpdatePanelFixups()
{
     ScriptManager.RegisterStartupScript(this, typeof(XXXXYourApplicationPageClassXXXXX), “UpdatePanelFixup”, “_spOriginalFormAction = document.forms[0].action; _spSuppressFormOnSubmitWrapper=true;”, true);
}

Note: This works for Application Pages only. If you are building a WebPart and having the same issue then the fix for this is mentioned in the links below.

Other useful resources:
http://www.telerik.com/community/forums/aspnet-ajax/ajax/ajax-controls-in-sharepoint-application-page-causing-postbacks.aspx
http://sharepoint.microsoft.com/blogs/mike/Lists/Posts/Post.aspx?ID=3
http://www.marten-online.com/sharepoint/ajax-second-postback-not-working-in-sharepoint-in-updatepanel.html


Cannot find Error Pages in IIS 7.0 Manager

September 8, 2009

The Error Pages icon was missing from Internet Information Services Manager on my Vista machine.

This feature will need to be turned on in Windows Features:
Control Panel > Programs and Features > Turn Windows features on or off

Check the box next to:
Internet Information Services > World Wide Web Service > Common Http Features > HTTP Errors.


Unable to start debugging on the web server

September 8, 2009

Unable to start debugging on the web server.

Server side-error occurred on sending debug HTTP request. Make sure the server is operating correctly. Verify there is no syntax errors in the web.config by doing a Debug.Start without Debugging. You also want to refer to the ASP.NET and ATL Server debugging topic in the online documentation.

Microsoft Vista Business, IIS 7.0, Visual Studio 2005

I was getting this error whilst trying to debug a Visual Studio 2005 .NET v2.0 project which uses the local IIS rather than the built in Visual Studio Development Server.

I tried many things to fix this error, permissions, updates, reg_iis, etc. However what worked for me was by changing the Application Pool for my application from DefaultAppPool to Classic .NET AppPool.

Why does this work? By default the DefaultAppPool runs in Integrated Managed Pipeline Mode and the Classic .NET AppPool runs in Classic Managed Pipeline Mode.

Integrated Managed Pipeline Mode
This is new in IIS 7.0 and essentially wraps IIS and ASP.NET into one process model.

Classic Managed Pipeline Mode
This is backwards compatibility mode for IIS 7.0 and handles requests in an IIS 6.0 worker process. IIS and ASP.NET are separated.

So why did this break my app?
My app was originally upgraded from an earlier version of .NET to .NET 2.0 and so is not IIS 7.0 compliant. I will need to migrate it so it can utilise the new integrated mode in IIS 7.0. This migration process is documented here.
http://learn.iis.net/page.aspx/381/aspnet-20-breaking-changes-on-iis-70/

Update
The HTTP Error I was receiving was 500.24. By following the article above all I needed to do to add the below to the web.config and now my app runs correctly in Integrated Managed Pipeline Mode.

<system.webServer>
<validation validateIntegratedModeConfiguration=”false” />
</system.webServer>


Add a New Security Role (Permission Level) in SharePoint 2007

May 26, 2009

1) From the Site Collection go into ‘Site Settings’.
2) Under ‘Users and Permissions’ go into ‘People and Groups’
3) On the side menu go into ‘Site Permissions’
4) From the Toolbar click ‘Settings’ > ‘Permissions Levels’

From here you can create and edit your ‘Permission Levels’ aka ‘Roles’.

Took me a while to find this. Hidden in the depths of one of SharePoint’s sub-sub-sub menus. The API uses the term ‘Role’ however elsewhere this is known as ‘Permission Level’.


Visual Studio 2005 asp.net debugging error

March 19, 2009

I received the below error whilst trying to debug an ASP.NET app using Visual Studio 2005 on Windows Vista using IIS 7.0

The web server is not configured correctly. See help for common configuration errors. Running the web page outside of the debugger may provide further information.

Turns out that compilation debug = true needs to be specified in the web.config

<compilation debug=”true”>


Error opening master page in SharePoint Designer

February 26, 2009

I had recently updated a custom Master Page. When trying to open this Master Page in SharePoint Designer I received this error.

soap:ServerServer was unable to process request. —> The file http://server/sites/site/_catalogs/masterpage/xxxxx.master does not exist.

I could see the page in the list however I couldn’t open it. All other files appeared do be fine and would open normally.

Back in a web browser I tried manually checking out the Master Page from the Master Page Gallery, which worked fine. However when I tried to check the file back in again it errored.

There is no file with URL ‘_catalogs/masterpage/xxxxx.master’ in this Web. at Microsoft.SharePoint.Library.SPRequestInternalClass.CheckInFile(String bstrUrl, String bstrWebRelativeUrl, Int32 iCheckinType, String bstrCheckinComment, Boolean bIsMigrate, Int32 iEditorId)
at Microsoft.SharePoint.Library.SPRequest.CheckInFile(String bstrUrl, String bstrWebRelativeUrl, Int32 iCheckinType, String bstrCheckinComment, Boolean bIsMigrate, Int32 iEditorId)

In the end I had to manually re-upload my custom Master Page into the Master Page Gallery.

This has fixed the issue however I am still unclear as to why it failed in the first place.


Drupal and LAMP for the Windows Developer

January 21, 2009

A friend of mine has started his own company which specialises in recruitment campaign management and advert trafficking.  He asked me to build him a corporate website. Ordinarily when I create websites I use my tried and trusted .NET and SQL technologies however I was conscious that the cost of running a .NET solution for a small start-up would be excessive when open source technologies are comparatively cheap. Also, as I try to have a life outside of coding, I didn’t want to spend my evenings supporting his website. Ideally I wanted to use a Content Management System (CMS) that, after I configured it, could be maintained by a non-coder. So the requirements were: 

1) Cheap to run
2) Easy to manage
3) zero code to write
4) Content Managed

After a bit of digging around the internet for reviews of CMSs I had a shortlist of Joomla and Drupal. As far as I can tell there is much of a muchness between them with regard to managing content of a simple site. I think Joomla is easier on the get go as Drupal can be a bit overwhelming at first. In the end I chose Drupal for no other reason then a friend of mine is working with them at the moment and there are a lot of free custom modules. These CMSs are free. Free!

The only trouble for me was they used technologies I have zero exposure too – the LAMP stack (Linux, Apache, MySql, PHP). For the past 8 years I have used nothing but the WISA stack (Windows, IIS, SQL Server, ASP or ASP.NET). Broadening my exposure to other technologies other than Microsoft has been something I’ve been meaning to do of late. Open source technologies have been gaining ground for sometime now and are ‘almost’ a viable solution for the average company.

So with a mug of tea in my hand I bravely set out to get to grips with this open source malarkey. The first thing to do was to get a WAMP (Windows, Apache, MySql, PHP) stack on my PC. The best way to do this is to install xampp. XAMPP is a preconfigured WAMP stack for development purposes. It was straight forward to install. It did complain about port 443 being in use which I found out was Skype had got hold of it first. Rather than solving this problem I just kill Skype whenever I need to use XAMPP. As there is nothing to register or install for XAMPP then there is nothing stopping you from copying all the files onto a USB stick for your own portable development environment. Ideal for WAMPing during your lunch break. Very nice.So I now had my stack configured ready to install Drupal. This didn’t prove to be an issue. I would say though for all of the above you must read and re-read all the installation instructions. The instructions are easy enough to follow but for a newbie like myself it can feel a bit alien. Make sure you are happy with MS-DOS as you don’t get your nice Windows dialogs for configuration settings. There’s a bit of hacking about with config files

Getting Drupal to look and function as you want takes a bit of time to get used to. The paradigms are similar regardless of what technology you use so most of the time its just working out what Drupal calls something that you may call something else.

As for hosting, after reading some good reviews about Clook on the Drupal forums I decided to use them to host the CMS. They were (as of writing) £5 a month or £50 for the year for the basic package which included the LAMP stack. Also as part of the control panel there is a one click deployment of Drupal (and Joomla and other CMSs). I was very dubious of how ‘one-click’ it would really be. In the end it was quite remarkable – it creates and sets up the MySql database and then installs Drupal into it. Web Hosting is really getting quite sophisticated these days.

I haven’t needed to use any MySql or php coding yet and I don’t think I’ll need to. There are plenty of free custom modules for Drupal which will do everything you need and if they don’t then you are probably doing something wrong – or very customized.

So to sum up a very successful project. It took me less then 20 hours to learn enough about LAMP/WAMP and Drupal in order to set up a simple working content managed website which we can build upon in a structured way.


Error trying to deploy a feature to SharePoint

December 1, 2008

Using VS2005 to deploy a solution that I have been been working on previously without issues.  One day it decided to play silly buggers.

“This solution contains two assemblies with the same name, or the SharePoint server already has an assembly with the specified name”

I went into the GAC and deleted all the assemblies related to my deployment.  Deployment still errored but with another error (assuming this is progress).

“The solution can not be deployed.  Directory associated with feature XXX in the solution is used by feature YYY installed in the farm. All features must have unique directories to avoid overwriting files”

I deleted my feature from \12\template\FEATURES and tried again (another error, but different this time).

“The feature name XXX already exists in SharePoint. You need to rename the feature before solution deployment can succeed”

To fix this you need to completely remove the feature from SharePoint.

go to the administration SharePoint site > Operations > Solution Managagement.  Then retract AND THEN uninstall the feature from the same screen.

Deploying then worked.  Unsure as to why this started to misbehave and if it happens again I’m just going to uninstall the feature straight away and try again.


programmatically add a My Link.

November 7, 2008

This is how you add a My Link (aka QuickLink) in code.

Add a Reference to Microsoft.Office.Server

Import/using
Microsoft.Office.Server
Microsoft.Office.Server.UserProfiles 

Dim context As ServerContext = ServerContext.Current
Dim profilmanager As UserProfileManager = New UserProfileManager(context)
Dim profile As UserProfile = profilmanager.GetUserProfile(SPContext.Current.Web.CurrentUser.LoginName)
Dim qlmanager As QuickLinkManager = New QuickLinkManager(profile)
Dim ql As QuickLink = qlmanager.Create(pTitle, pUrl, pQuickLinkGroupType, pGroup, pPrivacy)


Follow

Get every new post delivered to your Inbox.