Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SharePoint > SharePoint 2010 > BOOK: Beginning SharePoint 2010 Development
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning SharePoint 2010 Development
This is the forum to discuss the Wrox book Beginning SharePoint 2010 Development by Steve Fox; ISBN: 978-0-470-58463-7
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning SharePoint 2010 Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old July 1st, 2010, 10:53 AM
Registered User
 
Join Date: Jul 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Cool A Web Part or Web Form Control on this Page cannot be displayed or imported. The typ

Hey,
I'm working on the sample for Chapter 2 titled - Create a Custom Web Part Programmatically (pg 60). I'm able to do a build and run the new project in debug mode. However, after trying to add the new web part to the site, I get the following error.

"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."

I'm assuming this is will continue to be an issue throughout the rest of the book for me unless I get this resolved for this sample. What do I need to do in order for this web part to run successfully?
  #2 (permalink)  
Old July 2nd, 2010, 02:00 PM
Registered User
 
Join Date: Jul 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Lightbulb

Ok,
I've spent several hours working on this and now understand what the problem is. The issue deals with the namespace MyFirstWebPart.MyFirstWebPart within the code. I was able to first create a blank web part and then after that create a web part with the author's code to get this working.

I'm glad it was just this that was the issue as the community recommended creating a strong name for the assembly, opening up the web.config file to add a new safecontrol line item, and then finally adding the assembly to the gac. As this is my first experience with web parts, it seemed to require a lot more steps for something that you shouldn't have to think twice about.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using querystring in Form Web part.. JalpaPatel BOOK: Professional Microsoft Office SharePoint Designer 2007 ISBN: 978-0-470-28761-3 1 February 11th, 2010 07:39 AM
Validation in Form Web Part JalpaPatel BOOK: Professional Microsoft Office SharePoint Designer 2007 ISBN: 978-0-470-28761-3 2 September 3rd, 2009 08:57 AM
Web User Control Not rendering in Web Form dotnetDeveloper ASP.NET 3.5 Professionals 1 April 6th, 2009 04:02 PM
Can we validate only a part of a web Page mallikalapati ASP.NET 2.0 Professional 2 March 28th, 2008 08:12 AM
set Focus to web control in Web form vivekshah C# 1 June 17th, 2006 03:25 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.