Get Central Administration Webapplication
With this code you can get the central administration webapplication.
1: private static SPWebApplication GetCentralAdministrationWebApplication()
<span class=lnum> 2: </span>{ 3: SPWebService cS = SPWebService.ContentService;
<span class=lnum> 4: </span> var service = cS.Farm.Services.GetValue<SPWebService>(<span class=str>"WSS_Administration"</span>);
5: SPWebApplicationCollection webApplications = service.WebApplications;
<span class=lnum> 6: </span> <span class=kwrd>foreach</span> (SPWebApplication webApplication <span class=kwrd>in</span> webApplications)
7: {
<span class=lnum> 8: </span> <span class=kwrd>return</span> webApplication;
9: }
<span class=lnum> 10: </span> <span class=kwrd>return</span> <span class=kwrd>null</span>;
11: } If you have a better way, let me know 🙂
Control.ClientID has wrong value
An ASP.NET Controls has a ClientID property. SharePoint Controls inherit from the ASP.NET Controls. The property will give you the ID, the rendered control will have in the HTML source. There is one thing to remember:
The ClientID is valid only, if the control has been added to the Controls of the Page!
| ID **before** adding the control | ID **after** adding the control | FilterButton | **ctl00\_m\_Webpart1_**FilterButton |
So if you need the ClientID e.g. to pass it to a JavaScript to be able to find the control, make sure you grab the ClientID after the control has been added to the Page.
New WSPBuilder version
Carsten Keutmann has released a new version of his great WSPBuilder. Here are the new features:
- A Reference folder under GAC and 80/Bin is now supported for large dlls that do not need reflection for SafeControls and Permissions.
- New menu function “Recycle the Windows SharePoint Services Timer” implemented on WSPBuilder Extensions.
- Refactoring of “Copy to GAC” in order to improve the functionality.
- Bug fixed! “Unable to get solution id from manifest: Unable to extract manifest.xml …” error for x64 systems.
- CabLib.dll updated to new version 10.5.
- Its now possible to include the Cablib.dll into the WSP package.
The download (incl. source code) is available on CodePlex: Download WSPBuilder
Update: Custom Field – Upload Files and Images
Inserted links are now relative.
Go to the original post for more information and the download link.
Multi Level Navigation
The out-of-the-box WSS navigation offers one level of navigation. The navigation elements can be configured in the site settings.
There is a way to make it have multi level navigation, as MOSS does, by changing the DataSource. But this “hack” is not flexible, as you can not reorder the item within the navigation menu.
While I was reading the post How to create your own Cascading Navigation using the ASPMenu control, the decision was made to build a custom navigation which supports multiple navigation levels.
Using SharePoint Controls
Back from vacation. 1 week with an offline version of feeds is hard. So I read the postings I got closely 🙂 One post I do want to bring your attention to, is about SharePoint Controls.
My post about using the SharePoint Controls shows how to use the controls you see in forms (TextField, NumberField, LookupField…).
There are plenty of SharePoint controls, which you can use. Robin Meure has written a post “re-using SharePoint controls”. The controls in his post are: