Tags
I keep forgetting the tricks, just add “?contents=1” at the end of the page you can access the Web Part Page Maintenance (Webpart manager) to remove web part
10 Wednesday Nov 2010
Posted Sharepoint
inTags
I keep forgetting the tricks, just add “?contents=1” at the end of the page you can access the Web Part Page Maintenance (Webpart manager) to remove web part
10 Wednesday Nov 2010
Posted Sharepoint
inTags
I removed them manually in SQL. For future reference here there are.
Replace the GUID strings with what ails your system…
SELECT * FROM WSS_Content_2007.dbo.Features WHERE FeatureId = ’75a0fea7-cd50-401e-af0e-782f3662a299′
SELECT * FROM WSS_Content_2007.dbo.WebParts WHERE tp_WebPartTypeId like ’68ec641-8c6a-1cc6-6465-185094919a93′
Just replace the "SELECT *" with "DELETE" to remove them…
28 Tuesday Jul 2009
Posted Sharepoint
inTags
You know you can’t add a webpart zone into Master page directly, but there is tricky you can do it.
Just add
<asp:ContentPlaceHolder id="WeatherPart" runat="server"></asp:ContentPlaceHolder>
In the pagelayouts, set a control with the same id-name and place your webpartzone inside. You have to do this for every pagelayout that needs a header image in the masterpage. For each page though, there has to be added a image webpart, or whatever webpart you like. So be aware of this, if you use a webpartzone in your masterpage.
<asp:Content ContentPlaceHolderId="WeatherPart" runat="server"> <div> <WebPartPages:WebPartZone runat="server" Title="WeatherPart" ID="WeatherPart"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </div> </asp:Content>
24 Friday Apr 2009
Posted Sharepoint
inTags
Atidan Document Explorer for SharePoint is a tree-view control that displays your Microsoft® SharePoint site’s document library structure and content in the familiar explorer type view.
Document libraries and associated contents are presented in an intuitive, collapsible, hierarchical format.
The is a great control, but the problem is it displays all document libraries under site. Because it is using User Control and no property to set. So I decide to extend the web part which allow user specify the document library.
You can download the source from here.
29 Monday Sep 2008
Posted Sharepoint
inTags
Symptom:
Often times, developers in WSS3.0/MOSS2007 probably run across the issue where a web part is dropped on to a page
and then Sharepoint errors out for one reason or the other. Sometimes, the user is directed to a Web Part Maintenance page,
which helps the developer remove the offending web part from the page.
However, there is no way to get to this page from any easily available link.
Resolution:
In order to get to the Web Part Maintenance page for ANY sharepoint url, try the following trick.
Append the querystring ?contents=1 to the url in the browser as shown below
http://portal/area/default.aspx?contents=1
29 Monday Sep 2008
Posted Sharepoint, VS2008
inTags
To call a WCF Web Service, your code needs to have a config file. To do this in Sharepoint 2007, you need to use the web application config file so you can edit the web.config file of that web application adding the bindings and the client sections to the system.serviceModel section making the web.config file will look something like that. Add ServiceModel seciton after configSections
The way I did is to create a WCF in VS 2008. Hosted and create a webpart in vs 2008. Use the same way to add service reference and write some code. Remember always catch excpetion in webpart otherwise the whole page will not work. Deploy the web part and modify the web.config to add ServiceModel.
26 Friday Sep 2008
Posted Sharepoint, VS2008
inTags
This webpart will list all the sites you have permission to access.
Create a webpart project in vs 2005/2008,below is the source code:
[Guid("56d8a90d-8186-4333-b05d-f3b6b47a132c")] public class SiteList : System.Web.UI.WebControls.WebParts.WebPart { protected override void CreateChildControls() { base.CreateChildControls(); try { SPWeb Web = SPControl.GetContextWeb(Context); SPWebCollection webs = Web.GetSubwebsForCurrentUser(); if (webs.Count == 0) { } else { SPTreeView siteTreeView = new SPTreeView(); siteTreeView.ExpandDepth = 10; int i = 0; foreach (SPWeb webToDisplay in webs) { siteTreeView.Nodes.Add(new TreeNode(webToDisplay.Title, webToDisplay.Url, "", webToDisplay.Url, "")); TreeNode topNode = siteTreeView.Nodes[i]; ProcessWeb(topNode, webToDisplay); i++; } Controls.Add(siteTreeView); } } catch (Exception ex) { Controls.Clear(); Label errorMessage = new Label(); errorMessage.Text = "There was an error in the code. Please contact your system administrator and rely the following " + "message: " + ex.Message; Controls.Add(errorMessage); } } private void ProcessWeb(TreeNode topNode, SPWeb subsite) { SPWebCollection webs = subsite.GetSubwebsForCurrentUser(); foreach (SPWeb webToDisplay in webs) { topNode.ChildNodes.Add(new TreeNode(webToDisplay.Title, webToDisplay.Url, "", webToDisplay.Url, "")); ProcessWeb(topNode, webToDisplay); } } }
26 Friday Sep 2008
Posted Sharepoint, VS2008
inTags
In some situations, it will be necessary to debug a web part. In order to make a WSS web part able to be debugged, the web.config of the WSS web site where you deploy your webpart to must be modified.
Open the Web.config file and modify the existing options to look like the following:
<customErrors mode=“Off” />
<compilation batch=”false” debug=”true“>
Once the web.config is modified, you can directly set breakpoint and hit F5 in a Visual Studio environment.
26 Friday Sep 2008
Posted Sharepoint, VS2008
inTags
One of the tricky bits with developing WebParts using Visual Studio 2005 is the deployment aspects.
As mentioned in this article, you firstly have to create a strong-name key, and compile the DLL, load the assembly into the GAC, and include as a SafeControl.
There are STSADM scripts that can be used to do the same thing or you need to load your dll into Web Part Gallery
With the release of Visual Studio 2008, you can use SmartTemplate and WSPBuilder (Both available in CodePlex).
It registers the DLL in the GAC, adds the feature (installfeature) and activates the feature (WSP) for each chosen Web Application.
When the wizard completes, just have to flip back to SharePoint to turn it on for each particular Site Collection :
* Site Settings > Site Collection features > Activate
The WebPart will then be available from the WebPart gallery, and can be added to a page.
This is a great time-saver – making deployment of WebParts much easier.
You also can use Deploy function to deploy the dll for quick test.
There is a good example to show you how to do it. http://www.aspfree.com/c/a/Windows-Scripting/Beginning-SharePoint-Web-Part-Development/1/
But the problem is if you redeploy you may get error:
“This solution contains two assemblies with the same name, or the SharePoint server already has an assembly with the specified name.” when deploying a solution using the Visual Studio Extensions for SharePoint (VSEWSS) after you have already deployed it to a different site on the same server.
Answer:
Remove the solution’s assembly from the Global Assembly Cache (GAC).
· Gacutil /uf assemblyName (note: no .dll extension is specified)
· Rename or Remove the feature from “Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\FeatureName” (note: FeatureName may not be the same as assembly name – look in your manifest.xml to find the correct name)
If you deleted projects after you deploy the solution. You will get error as the manifest file still there.
Go to folder called pkg under your solution file folder and delete the folder which you have removed from solution
20 Sunday Apr 2008
Posted Sharepoint
inTags
Found 2 great webpart which can be used for learing purpose, you can download it from http://www.codeplex.com/smarttools