views:

341

answers:

2

How I can display SharePoint controls (such as the PeoplePicker) in an ASP.NET Page in Visual Studio 2008?

I drag and drop the PeoplePicker but it gives me: Error rendering control.

A: 

The peoplepicker(for example) needs the context of SharePoint (SPContext.Current) which simply isn´t present inside of VS. Use the sourceview and deploy to SP and everything works fine (or at least ok).

Johan Leino
+1  A: 

You can not display SharePoint controls inside Visual Studio because of their dependencies. The controls are only visible inside SharePoint Designer.

Are you trying to use SharePoint controls in ASP.NET which are not supposed to be run inside SharePoint? If so then it might be not a good idea for several reasons. See following thread for details

http://stackoverflow.com/questions/731500/sharepoint-controls-in-asp-net-application

If not then either SharePoint designer or code view in Visual Studio are your friends.

Faheem