Category Archives: Uncategorized

Renaming Web Part Namespaces (Or, One reason for “A Web Part or Web Form Control on this Page cannot be displayed or imported)”

I’ve been working to get my dev chops back and to that end, working on a hobby project that has the following bits:

  • Connected web part that receives a site or site collection URL from an out of the box SharePoint Text Filter web part.
  • This web part looks up all the info about the the selected site, generates an XML package and hands it off to another WP on the page (via connections).
  • 3rd web part receives the XML and does some XSL transform stuff.

I wanted to rename the name space of all the bits to “Nivlag” and I was getting hit up with the following error when I deployed the web part to  my test environment:

A Web Part or Web Form Control on this Page cannot be displayed or imported.  The type could not be found or it is not registered as safe.

This is a beginner’s problem but I thought I’d jot down a note on this anyway.  I caused the error when I right-clicked on the default name space (which defaulted to the project name), selected Refactor and then Rename like so:

image

That did rename things in a bunch of places in the project, but it’s not enough.  You also need to make several other adjustments:

1. Manually open up and edit a file, “ShaerPointProjectItem.spdata”. That an XML file that has a <SafeControls> section.  The namespace rename function isn’t aware of this file for whatever reason, so you need to update the Namespace there manually.

2. Manually edit the .webpart file.  For whatever reason, Visual Studio doesn’t change this reference either.  Change the "<type>” node to reflect your changed namespace there.

3. Lastly, depending on how you refactored the namespace change, visual studio may have also updated the string that references your .ascx file here:

private const string _ascxPath = @"~/_CONTROLTEMPLATES ……

You may need to change that back.  You’ll because you’ll get an error similar to the following when you try and add the web part to a web part zone on a  page:

Server Error in ‘/’ Application.


The file ‘/_CONTROLTEMPLATES/Nivlag/VisualWebPart1/VisualWebPart1UserControl.ascx’ does not exist.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: The file ‘/_CONTROLTEMPLATES/Nivlag/VisualWebPart1/VisualWebPart1UserControl.ascx’ does not exist.
Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

 

Fix the reference there and you should be good to go.

4. Lastly, the actual ASCX file still had a reference (for me) to the old original namespace (the refactor/rename function didn’t fix this).  You’ll know about this error when you try and add the web part to the page and get the following message:

Server Error in ‘/’ Application.


Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type ‘RenameNameSpace.VisualWebPart1.VisualWebPart1UserControl’.
Source Error:

Line 6:  <%@ Import Namespace="Microsoft.SharePoint" %> 
Line 7:  <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
Line 8:  <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VisualWebPart1UserControl.ascx.cs" Inherits="RenameNameSpace.VisualWebPart1.VisualWebPart1UserControl" %>

Source File: /_CONTROLTEMPLATES/RenameNameSpace/VisualWebPart1/VisualWebPart1UserControl.ascx    Line: 8


Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927

Edit the .ascx file directly and fix the broken namespace.

At this point, I finally had a web part living in the namespace of my choosing.

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin

Taxonomy Discussions Will Never Go Away

There’s an unusual “theory” type thread going on here on the MSDN forums: http://social.technet.microsoft.com/Forums/en-US/sharepointgeneral/thread/34d11f89-4405-4ba5-b0f0-faa5af6e6ad5/

A lot of MSDN forum questions are very “how do I do [x]” in nature.

This is a big topic and some of the key issues are being addressed pretty nicely in the thread.

Join in the fun!

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin

Use Calculated Columns to Close Technical Gaps in SPD Workflows

Here’s another article I wrote for www.sharepointbriefing.com.  This one describes a technique that we can in SharePoint Designer to perform calculations that aren’t possible using any of the built-in calculation-style activities.  The basic idea is to use a custom list as a calculation engine – define a list that performs the calculation correctly, create an item via SPD and then read the result.

Here’s a teaser:

image

Read more about it here: http://sharepointbriefing.com/features/article.php/3866646/Use-Calculated-Columns-to-Close-Gaps-in-Workflows.htm

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin

Create an Image Rotator in SharePoint Using jQuery

A while ago, I wrote an article for SharePoint Briefing (www.sharepointbriefing.com) that describes how to create an image rotator in SharePoint. Here’s a teaser:

image

Read the whole article here: http://sharepointbriefing.com/spcode/article.php/3861121/Create-an-Image-Rotator-in-SharePoint-Using-jQuery.htm

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin

Use jQuery to Kill Spell Checker in SharePoint Lists

“Use jQuery to Kill Spell Checker in SharePoint Lists” – that’s the title of a recent article of mine that the good folks at www.sharepointbriefing.com posted earlier this month.

Here’s a teaser:

image

Read about how and why I wanted to kill the poor spelling checker here: http://sharepointbriefing.com/features/article.php/3869816/Use-jQuery-to-Kill-Spell-Checker-in-SharePoint-Lists.htm

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin

Solution: SPD Workflow and “The form cannot be rendered …” Message

I was preparing today to give a demonstration on SharePoint 2010 focusing on SPD 2010 workflows.  As I was prepping, I hit this error when I tried to run a workflow manually:

The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service. For more information, contact your server administrator.

I had previously set up my farm on an underpowered laptop and in trying to help it out, I tried to turn off / disable a bunch of services, as shown:

image

It turns out that the State Service is pretty important 🙂

I reconnected my web app to the State Service I was immediately able to run my workflows.

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin

Small Note About Microsoft Online Services Passwords and Administration

I started to work with Microsoft’s Small Business Productivity Online Suite several months ago, but now I have some better reason to be using it. 

I’m still working my way around it, so I may be getting some of the terminology wrong, but basically there are two major interfaces: the administration center and the services themselves.

The system was telling me that I had to change my password, so I went ahead and did that.  That allowed me to proceed and work with the services part (SharePoint, email, and live meeting).  However, when I went to the administration screen, it wouldn’t let me in by telling me that it didn’t believe my password was correct.

The behavior was a little odd.  If I entered the password I *thought* it should be, it would blank out the userid and the password and tell me the password or userid was incorrect.  If I entered a blatantly wrong password, it would tell me the same, but keep the user ID field intact.

I’ve been playing around with this for a little while and finally called (yes, on a Sunday morning).  Incredibly, a fellow, Ben, answered the phone right away.  And, I didn’t have to enter a credit card.

Long story short, the administration center password uses different password rules than the services password.  Admin password must contain alpha, numeric and special characters.  When I changed my admin password the first time, I didn’t follow that rule (nor did it warn me!).  I was able to change it to a valid administration password and got back in.

If you experience that kind of problem in future, you know what worked for me and hopefully it will work for you.

</end>Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin

Social Computing Book for SharePoint 2007

In mid July, I was offered a chance to author two chapters for Brendon Schwartz’s and Matt Ranlett’s up-coming book, Social Computing with Microsoft SharePoint 2007: Implementing Applications for SharePoint to Enable Collaboration and Interaction in the Enterprise.  (I think they were trying to win a length contest with that title; I think they won).  I jumped on the opportunity and now, finally, the entire book is done, arriving at stores in February.

As SharePoint matures, publishers have begun to produce a new wave of books.  This book is part of that wave.  This wave builds upon the previous round of technical reference manuals explaining core features and functions and begins to describe how to use those features and functions to deliver business value in a very non-superficial way.  I’m not saying that is anything superficial about reference manuals or their value.   In fact, a book like this on Social Computing probably couldn’t have been written a year ago.  (Literally, of course it could have been written, but I don’t think the larger community would have been ready for it).  The new wave of books tends to assume the reader basically understands core features and instead describes how to use those core features in interesting new ways. 

As the title plainly says, this is a book about Social Computing.  Social Computing is a subject ripe for discussion and exploration and indeed, the discussion is well underway among early adopters.  Many companies are now quite comfortable with document libraries, content types, search, basic workflow, etc.  Having implemented and mastered these bread and butter features, they are ready for the next level.  This book offers insights and strategies to do that and thereby, exploit new and interesting opportunities that Social Computing brings to the world.

Social Computing is a big and evolving subject and covers a lot off things, including blogs, wikis, social tagging, search, interactive media, mashups, "people," and other socially-oriented "stuff."  SharePoint has a very strong story to tell in this arena and now, at this time in Internet & SharePoint history, is the time to tell it.  All things being equal between companies, those that successfully leverage Social Computing will outpace and outgrow those that do not.  The train is getting ready to leave the station and you don’t want to miss it!  This book is your ticket for a seat on that train 🙂

Bottom line, this is a blog entry pitching the book.   It’s due out in February.  Pre-order it here: Social Computing with Microsoft SharePoint 2007: Implementing Applications for SharePoint to Enable Collaboration and Interaction in the Enterprise

(Full disclosure — there’s no royalty money in it for me if you choose to buy the book, so this isn’t an effort to boost my savings account, though if it sells well, it will help out my ego, which always wants more, more, more!)

As an aside, but very important aside, I thank Bob Fox for connecting me with Brendon.  And naturally, I thank Brendon and Matt for taking a chance on a newbie such as myself and letting me author chapters in their very important book!

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin

Technorati Tags:

Using Delicious.com to Track SharePoint “v.next” Information

As I find resources on the web discussing features available in the next version of SharePoint, I’ll be adding them to my delicious bookmarks.  It appears that Delicious allows people to subscribe to a particular tag, so if you’re interested in what I find, when I find it, subscribe here: http://feeds.delicious.com/v2/rss/pagalvin/SharePoint_O14?count=15

</end>

 Subscribe to my blog.

Technorati Tags:

Congratulations, Natalya!

I just received word that my friend and colleague, Natalya Voskresenskaya was awarded MVP for SharePoint today.  I’ve been working with Natalya for almost 18 months now and it’s a well-deserved recognition.  Like all the MVPs I know, she’s strongly motivated by the community and her work with ISPA, among other things, is helping to make the SharePoint community one of the strongest and most helpful of any technically oriented effort on the planet.

Congrats!

</end>