webparts

Hiding a SharePoint Web Part from code behind

I wanted to hide a web part when there are no results in that web part. Could anyone help me how to do this in SharePoint? Thanks in Advance Carol ...

how to trigger page refresh

Hello everyone, I am developing a webpart using VSTS 2008 + C# + .Net 3.5 + IIS 7.0 + ASP.Net. I want to refresh the whole page in my WebPart code, refresh I mean the same effect when user press F5 for browser. I did not find a solution yet, any ideas? thanks in advance, George ...

ListFieldIterator shows ["Title" column value]

Hello. I am writing a webpart for SP 2007 with ListFieldIterator. If ControlMode equal to SPControlMode.Edit or SPControlMode.New it works good. If ControlMode equal SPControlMode.Dispaly i see ["Title" column value] for Title column and ["SomeColumn" column value] for each other columns. How I can fix it? ...

Retrieve SharePoint List Data and bind this to a dropdownlist

Hi All, I'm fairly new to SharePoint so apologies in advance for sounding like a 'Newbie'. I have created a simple Webpart, which uses a Web User Control - [.ascx file] to provide all the controls for the Webpart. On the .ascx file, there is a DropDownList which is hard-coded at the moment and works well in the Webpart (within a ShareP...

How do I make a webpart's settings configurable in Sharepoint?

I am using SharePoint Server 2007 Enterprise with Windows Server 2008 Enterprise. I am publishing a portal template. I want to develop a WebPart and make some settings configurable (just like we can configure parameters for a console application in app.config) For example, authorized users could set parameters of WebPart in Edit Pa...

How to register a stylesheet on a Master Page within a Web Part

How would I register a Style Sheet on the Master Page within a SharePoint Web Part. In other words how would I add a CSS link on the master page, at run time, and the code which does this is present in a custom web part. I do not want to change the Master Page directly. I could not see anything in the API (this.Page.Master) which woul...

SharePoint AJAX Web Part 401.2/3 errors

I recently began writing an AJAX web part for use in SharePoint and I am having a strange error. It seems that EnsurePanelFix() is causing the web part to throw a 401 error; in the log, both 401.2 and 401.3 errors are showing up right around the same time. I made some changes to EnsurePanelFix() after doing a bit of research on here and ...

Web Parts & User Instance without SQL Express

Hi, I'm having hard times with the SQL Error Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed. No matter what I do (yes, I have the SQL Express running in the Local account and deleted the SQLExpress folder on Local Profile), users under ...

whats new in .net 4.0 for webparts

I have to decide whether to use .net 3.5 or 4.0 for a webportal, I have found that webparts cannot be moved accross the webpartzone also there is problem with verbs. What is new in .net 4.0 for webparts and which is better 3.5 or 4.0 ? ...

how to show current user's inbox in sharepoint 2007

I found this web part for Exchange 2003, but in exchange 2007 even after user login, web part shows exchange 2007 owa login page (instead of current user inbox). How I can show current user's exchange 2007 inbox in moss 2007? Any Idea? ...

64 bit webpart on SharePoint 2007 32 bit

If I develop a 64 bit webpart DLL does it work with SharePoint 2007 32 bit? ...

how to use javascript and css in WebPart?

Hello everyone, I am using SharePoint Server 2007 Enterprise with Windows Server 2008 Enterprise. I am using publishing portal template. I am developing using VSTS 2008 + C# + .Net 3.5 + ASP.Net. And I want to develop a WebPart, which refers css and javascript (.js) files. My question is (1) how to deploy css/javascript files and (2) ho...

Sharepoint-customizing usercontrol property in smartpart

Hi, If anyone is having idea how to customize properties in a smartpart. I have created usercontrol and i m wrappin it in a smartpart.I want to upload my xml from Document library. private string feedXML; [Browsable(true), Personalizable(true) ] public string FeedXML { get { ret...

[SharePoint] - Asynchronous methods in a webpart

Hi all, I have been coding for some days on a webpart now. The point of this webpart is to clean up a given document library. I have 16 000+ msg files in there and I have to validate the To and From headers of each msg file against some given rules. All is well, except for the fact that this process takes forever. All possible values ...

XML document within Sharepoint webpart codebehind

Hi, I am loading an XSLT file in c# sharepoint webpart code as below: string path = context.Request.MapPath("/_layouts/RSSWeatherXSL.xsl"); XslTransform trans = new XslTransform(); trans.Load(path); // loading xsl file The XSLT file is rather large around 134 lines. I need to reference images within the XSLT the path to wh...

convert asp.net code to WebPart code issue

Hello everyone, I am using SharePoint Server 2007 Enterprise with Windows Server 2008 Enterprise. I am developing using VSTS 2008 + C# + .Net 3.5 + ASP.Net. I have the following code which works correctly in ASP.Net (aspx) and I want to implement the same function in a WebPart and deploy into a page of SharePoint publishing portal site....

Sharepoint Webpart Properties / Rich text box ?

Is it possible to make a String in a web part properties editable with a rich text box (to be able to use the Bold, etc.) ? UPDATE / SOLUTION The 1st class is the "Custom property" that should appear in the toolbar using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft...

sharepoint persistence

I'm pretty new to SharePoint Web Part development, so I'm not sure the best practices for handling data persistence. In my application, user postbacks will be modifying some underlying data structure that I would like to maintain rather than rebuild. The two things I have tried so far are making objects serializable, and storing them...

Asp.Net tree view in SharePoint webpart- Input string error

Hi All, I am facing a very strange issue. I have a SharePoint webpart that displays an asp.net tree view. It takes tree depth from a drop down. To improve performance of the tree view, i am setting the PopulateOnDemand property to true for the last level of the tree depth. For example, if i have a total of 10 levels in the data and the...

Sharepoint web parts Rendering html and controls

Hi, I have a webpart that displays HTML output within the RenderWebPart method and also creates controls within the CreateChildControls both methods are declared as overridden in the webpart. My question is how to I control the order of the display of the controls and html output? At the moment I call EnsureChildControls() within the ...