webparts

Deploy a visual webpart developed with VS2010 to Sharepoint 2007

Hi, I developed a simple webpart using the Visual Webpart template in Visual studio 2010 and has been testing it within Sharepoint 2010. I want to know if this webpart could be deployed to Sharepoint 2007 from the .cab generated by VS2010, and if so, how? Thank you. ...

Sharepoint Webpart custom properties get default values on server reboot

I have noticed that the custom properties of a webpart I developed return to their default values when I reboot my machine. Is that a normal behavior? are the properties saved as far as the server is up, or there is some parameters I am missing. Thank you. EDIT: code: namespace TestWebpart { [ToolboxItemAttribute(false)] [Xml...

Top-level exception handling for (visual) web parts

I've looked into this quite extensively and I've found the following: You can do some clever stuff to catch most errors by implementing a base class, see Andreas Knudsen's solution for this. The Error event in UserControl never gets fired, see details here: http://weblogs.asp.net/vga/archive/2003/06/16/8748.aspx What I can't find is ...

SharePoint - Dynamically Setting a property on a webpart. Possible with inline C# code block ? or Javascript?

I want to dynamically set the FilterValue1 property of a Content by Query to the querystring IDs value. I tried to do it with an inline embed FilterValue1="<%= Reponse.Write .. but no luck Without having to code my own webpart, any way to change the property value with a small C# code block on the aspx page? How about with javascript?...

Summary Link Web Part conflict with custom web part in SharePoint 2007/2010

Hello I have a problem of getting Summary Link Web Part (SLWP) work correctly for ages. There is no problem, if I add SLWP first to a page and add all links before I add a custom web part. However it doesn't work the other way, even adding a new link to SLWP is not possible after the custom web part is added. The new links do appear in...

Get Current SPWeb From Web Part

I'm working on a WebPart, to be used in SharePoint, that will display a listing of documents within a document library. To do so, I believe I need to reference the SPWeb object for which the web part is hosted on. Unfortunately, I don't see how to access the current SPSite or SPWeb from within a WebPart. How would I access these from wit...

what is equivalent to allowlayoutchange="false" allowpersonalization="false" allowcustomization="false"><ZoneTemplate> in object model

what is equivalent to allowlayoutchange="false" allowpersonalization="false" allowcustomization="false"> in object model ...

Maintain position of web part in asp.net

I have created a web part in asp.net application and allowed user to change it position. Now, I want that once user comes back he/she will see the same setting of web part that he/she had left earlier. What is the best approach to maintain the web part position for that particular user. ...

ITransformableFilterValues interface with two or more parameters [SharePoint WebParts]

I working with Sharepoint, and I try to connect web-parts with multiple parameters. My question is how do I pass more than one parameter from a custome web part to another. I am able to pass one parameter by implementing the ITransformableFilterValues interface in the custom webpart , what I want to do is pass more than one parameter (...

Creating a "Mobile Adapter" for Visual Web parts in Sharepoint 2010

Hi, I've followed this guide on how to create mobile web parts in Sharepoint 2010, but no content is listed when I access the page with a mobile device, or use the "/m"-url. Are there any other sources on how to create a mobile adapter for visual web parts for Sharepoint 2010? My adapter-class looks like this: using System; using Syst...

Using WebRequest.Create inside RenderControl() for WebParts

I need to call a web service to receive a JSON object which I'll parse before rendering the content. Here's the code for the same: Dim jResponse As MessageResponseWrapper = New MessageResponseWrapper() 'Custom class to deserialize JSON Dim req As System.Net.HttpWebRequest req = System.Net.WebRequest.Create("http://some-c...

Silverlight adding to List<T> throws Object reference not set to an instance of an object.

I'm using Silverlight 4 on IE 8. I have created a new Silverlight web part for SharePoint 2010 that I am using to read 2 external content types. One represents the Invoices in the Chinook database from Code Plex and the other is the lines of each invoice. I am attempting to display the code in a Master-Detail layout using the Telerik Rad...

SharePoint Closed web part

Hi All, I have a site developed in MOSS2007. where can I see the list of web parts that are closed and the user name who closed that web parts i.e(ClosedBy). Or Else, if a perticular web part is closed, how can I get to know that web part is closed by whome? Thanks, Sachin Katkar. ...

SharePoint WebPart Type Question

I want to do some stuff to WebParts based on the type of WebPart is being passed to a method. I'm finding that I'm doing: if(obj is Microsoft.SharePoint.WebPartPages.ContentEditorWebPart) ... else if (obj is SummaryLinkWebPart) It smells funny to keep doing this for all WebParts. Is there a design pattern that I should be using instea...

Develop a custom editable Visual Web Part (WebPart) for SharePoint 2010

I want to develop a webpart that allows editors to amend its content using Sharepoint's Ribbon-based formatting controls, and then display that content in a nicely formatted way. The built-in content editor webpart isn't sufficient because I want to wrap the content in hardcoded HTML so as to enforce my site's graphical design. Also, I w...

What are web parts?

What are web parts? What are the benefits and drawbacks to using them? Is there a difference between web parts in ASP MVC and Sharepoint? ...

Not all WebParts being picked up

I have the following: SPLimitedWebPartManager wpManager = web.GetLimitedWebPartManager(web.Url + "/Pages/Default.aspx", System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared); SPLimitedWebPartCollection webParts = wpManager.WebParts; I made test WebPart page, added Table of Contents WebPart and a PageView...

Visual Web Part in Sharepoint 2010 shows only XMLDataSource in GridView

I created a new Visual Web Part in VS 2010 (using Sharepoint Server 2010), then dropped a GridView on the User Control. However when setting up the DataSource for the GridView, I only get XMLDataSource as an option. There is no option to create a SQLDataSource for instance. does anyone know how to get over this limitation in Visual Stud...

Handling Postback within a Webpart in Sharepoint

I am initializing a GridView, text box and a button via code to a Webpart in CreateChildControls() The above controls are declared as class variables but initialized only later. Next, I've given the handler for button click. The handler function is supposed to work as a search - perform some operations on the content entered in the tex...

Controlling HTML of a WebPart's top-right drop down menu

I am reviewing some existing ASP.NET code that used ASP.NET WebParts. The web parts implement IWebActionable in order to control the items shown on the web part's top-right drop down menu. The rendered HTML for each context menu item looks something like this: <DIV> <A class="menuItem" onclick="stuff" href="javascript:void(0)"> ...