Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SharePoint > SharePoint 2010 > BOOK: Beginning SharePoint 2010 Development
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #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?
Reply With Quote
  #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.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 06: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



All times are GMT -4. The time now is 11:06 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.