Mavention Blog >
September 2009
Microsoft.SharePoint.WebControls and Context
Allot of controls found in Microsoft.SharePoint.WebControls can be used in custum code. Some of these controls get their values from the current SPContext. If you use for instance the ListFieldIterator to show the metadata from a listitem on another web you will get errors because it's using the wrong context. This can be fixed by using SPControl.SetContextWeb() but be awar that this will change the entire conext of the page. It will show your page but the menu and site actions think you are on the web of the listitem. There's no prefect solution for fixing this but one approach is to create an applicationpage and set the context using SPControl.SetContextWeb and load this in a pop-up or iframe.
Posted:
10-9-2009 19:59:36 by
Robert Jaakke | with
0 comments