webparts

How to detect the view mode (PersonalizationScope) of a SharePoint WebPart

How do I check programmatically whether a web part is displayed in the shared resp. in personal mode. ...

SharePoint webpart with button to auto-login to 3rd party website

I have been tasked with creating a SharePoint 2007 webpart that logs the user directly into our website (which uses forms authentication). Most likely the username and password will be same in the SharePoint account as in our website. Ideally we would like it to be fully integrated in that the webpart looks up the SP login & password, s...

How to apply multiple filters to sharepoint list

Hi all, I have sharepoint list with several columns - month, year and some custom data. I want to provide 2 dropdowns to allow user select month and year to filter rows. I added "Choice Filter" webpart for month and set connection to list (this works). I added second "Choice Filter" for year and I wanted to do the same. However, I can...

SharePoint Webpart and ASP.NET User Control

I am developing SharePoint Web Parts for MOSS 2007 on Visual Studio 2008. Up until now, I've been adding all my controls by hand to the code behind... but an earlier post suggested I could use the designer to create an ASP.NET User Control, then add it to the webpart, and everything is happy... See figure 5 for an example. However, I c...

Maximum number of web parts/web part zones per page? (Microsoft SharePoint 2007)

I've already found the max number of web parts per page: Customizable - in web.config file, <configuration><SharePoint><WebPartLimits MaxZoneParts="XX" /> 50 (default) - http://technet.microsoft.com/en-us/library/cc262787.aspx 100 (recommended max) - http://technet.microsoft.com/en-us/library/cc287743.aspx However, I've been unable t...

Sharepoint 2010 Publishing Image Field in a sandboxed solution

Hello, I am trying to read a list that contains a field of type Publishing Image in a sandbox webpart. However as soon as I reference the field with the following line, I get an error. SPList List = Web.Lists["ListName"]; SPItem Item = List.GetItemByID(1); Object o = Item["Image"]; The error is the type Publishing.Image is not marked...

Using Entity Framework as a Web Part's Data Source in Sharepoint 2010

I have a very simple web part. I have a single grid view, which I am populating using linq to entities (or at least that's what I want to do). The Entity Data Model .edmx file is located in the same project as the web part, and everything looks to be in working order. When I debug the project, it blows up on the entity model construct...

Sharepoint Web Part OnPreRender PostBack Dynamic TextBoxes Not Accessible In Button Handler

I have a custom webpart which extends System.Web.UI.WebControls.WebPart and implements an EditorPart. I have all the static controls being added in the overridden CreateChildControls method as I know this makes them persistent across PostBacks. However, I have some TextBoxes being added in the overridden OnPreRender method because the ...

Add the Date Filter SharePoint webpart to an ASP.Net page

How do I add the out-of-the-box SharePoint date filter webpart to an ASP.Net web page? I want to do it either in an ASPX... <%@ Register Assembly="<DateFilterDLL??>" Namespace="<??>" TagPrefix="DP" %> <...> <asp:WebPartManager ID="WebPartManager1" runat="server"> </asp:WebPartManager> <...> <ZoneTemplate> <DP:...

Create a SharePoint Web Part Site in Visual Studio?

I need to create a web part page to be used in a SharePoint collection site. Any ideas? ...

Programmatically tell whether a webpart that has been deployed is a native one that ships with MOSS, or one that was custom developed?

I have a SharePoint 2007 MOSS instance, and I'm on a fact-finding mission. There have been multiple developers, developing multiple webparts and deploying them (using VS2005/2008 SharePoint Extensions). I thought maybe I could look at the fields in the "Web Part Gallery" list in my site, and look by "Modified by", but it looks like a de...

Building webparts with Visual Studio 2010 Express

Hi, I'm trying to get started with building my own webparts, planning to follow this MSDN article. I've downloaded Visual C# 2010 Express - I'm not quite at the point where I feel comfortable dropping 1000 big ones yet, and I installed Visual Web Developer 2010 Express via the WPInstaller. Following through the tutorial, aside from th...

Sharepoint webpart combobox of lists

Hi, I have a webpart that works off of a list but what I'm trying to do create a dropdown that contains a list of sharepoint lists so that when the user edits the page and selects 'modify shared webpart' they are able to choose a list item and that gets parsed back to the webpart. Any examples or links to examples appreciated! Thanks ...

How to find missing web part ?

Does anybody know how to find offending web part which causes this error ? “A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe.” I have inherited an old SharePoint 2003 portal site which uses custom web parts. I know what this error means. I also know ...

Should my connected web parts support IWebPartField, IWebPartRow and IWebPartTable?

I've been writing some simple webparts, and they communicate via a custom interface type. That's working fine. I've got one ConnectionProvider, with a variety of ConnectionConsumers. I see that the OOTB SharePoint webparts provide many standard connections, apparently through IWebPartField and IWebPartRow (IWebPartTable seems less supp...

SharePoint Web Part on Masterpage not displaying on SubSite

Hi all, Scenario: - A out-of-the-box DataFormWebPart on masterpage connected to a top-level site List. - A subsite using that same masterpage from top-level site. - Error happens when accessing the sub site as below Stack Trace [InvalidOperationException: Operation is not valid due to the current state of the object.] Microsoft.Shar...

Is there a reference document for OOTB SharePoint web part interfaces?

I want my web parts to act as providers and consumers with Out-Of-The-Box (OOTB) SharePoint web parts, including filters. To design these web parts I need to know the interface of the OOTB web parts, eg. a "Links" web part provides an IWebPartRow, with a Type, URL and Notes. I can get the information by: a web part programmed to inte...

How to set an error message from EditorPart when ApplyChanges returns false?

I'm developing a custom ASP.Net WebPart using the WebPartManager and I'm creating a custom EditorPart too. For its EditorPart.ApplyChanges method I set the return value to false whenever there is an error. In the EditorZone I get a standard error message indicating that some error happened to the editor, but I want to change that mess...

Does an HTTPS SharePoint Site Need to Use HTTPS-Compliant Web Parts?

We are planning to create a new sub-site within our company's intranet site, which is built on SharePoint 2007. We want to add a 3rd-party weather web part (which is just a widget to display the local weather forecast) to the home page of the new intranet site. Since the intranet site uses HTTPS, do we need to find an HTTPS-compliant w...

SharePoint: Why is the Page property in my web part null?

I am trying to include an Image control within my web part. In CreateChildControls I have the following code: Image image = new Image(); image.ImageUrl = this.Page.ClientScript.GetWebResourceUrl(this.GetType(), "hotline.jpg"); I get a NullPointer exception and this is because 'Page' is null. Why might this be? Am I doing this all wro...