About Me

My photo
a Dynamic and Energetic guy.....
Showing posts with label Webparts. Show all posts
Showing posts with label Webparts. Show all posts

Wednesday, March 17, 2010

Why TFS portal webparts throwing an error - [Solution]


When we have configured sharepoint webportal for TFS, sometimes is throws an error when displaying "Project Dashboard" & "My Dashboard", all webparts displaying as missing components.


This is because, we have lost all webparts (basically dll's that renders webparts).
What we have to do is,
(1) Central administration --> Operations --> Solution management --> tswawebpartcollection.wsp --> DEPLOY




(2) Central administration --> Application Management --> Manage Web Application Features --> Visual Studio Team Foundation Server Configuration --> ACTIVATE



Now refresh your page :)

Monday, September 7, 2009

Sharepoint Webpart Concepts

In order to create WSS-style Web Parts, you must have a dependency on the Microsoft.SharePoint.dll and you must inherit from the WebPart base class in the Microsoft.SharePoint.WebPartPages namespace.

In order to create ASP.NET-style Web Parts, you have a dependency on System.Web.dll and inherit from a base class named WebPart in the System.Web.UI.WebControls.WebParts namespace.

When creating WSS 3.0 Web Part pages, you should use the WebPartZone control defined in the Microsoft.SharePoint.WebPartPages namespace. You do not want to use the WebPartZone control contained within ASP.NET 2.0.



Different controls contained in a WSS-style Web Part page


The preferred way to create Web Parts for WSS 3.0 sites is to create the ASP.NET style WebParts. As discussed before, this means inheriting from the WebPart base class in the System.Web.UI.WebControls.WebParts namespace and overriding the RenderContents method.

Wednesday, September 17, 2008

Create a webpart using Visual Studio

This is an old method, but i think this will be useful if someone has very basic knowledge.
User can add a usercontrol & any code can be in your usercontrol

using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.WebControls;
using System.Web.UI;

namespace UCAddSubjectNewsWebpart
{
public class UCAddSubjectNews : WebPart
{
UserControl usercontrol;
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
usercontrol.RenderControl(writer);
}

protected override void CreateChildControls()
{
base.CreateChildControls();
this.Controls.Clear();
usercontrol=(UserControl)this.Page.LoadControl("~/usercontrols/Name_of_user_control.ascx");
this.Controls.Add(usercontrol);
}
}
}

My Masters