Showing posts with label MOSS Development. Show all posts
Showing posts with label MOSS Development. Show all posts

Wednesday, August 5, 2009

How to know the version of the SharePoint you are using

Go to Control Panel -> Add and Remove Programs.
OR, Go to (Windows) Start>Run>
Type appwiz.cpl


Select the product (sharepoint server) and then click: Click here for support.

Or: Under Tasks, Click "View Installed Updates"
Doesn't it answer your querry? :) Window must have popped up and said about your current SharePoint version.

Tuesday, March 17, 2009

adding a new menu Item in Sharepoint. (SharePoint Features)

WSS 3.0 - How to create new SharePoint Feature?
How to create New Feature in WSS 3.0? / MOSS 2007

How to add new menu item under “Site Settings” menu in wss 3.0?

1. Create a new folder, called “SabinsNewFeature”, in C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES

2. Create an Xml file, called “feature.xml” in the “MyListUserFeature” folder
3. Edit the feature.xml file and add the following content


Title="Feature My List User Feature"
Description="Custom action on Site Actions"
Version="1.0.0.0"
Scope="Site"
xmlns="http://schemas.microsoft.com/sharepoint/">





4. Replace the GUID placeholder in the previous Id attribute, generate a GUID by running guidgen.exe, located in Local_Drive:\Program Files\Microsoft Visual Studio 8\Common7\Tools.

Create an Xml file, called “ListUsers.xml” in the “SabinsNewFeature” folder

5. Edit the file and add the following content


GroupId = "SiteActions"
Location="Microsoft.SharePoint.StandardMenu"
Sequence="1000"
Title="List Users">



6. Install the new feature by running the following command by going to Start>Run>cmd

change to the following directory: %COMMONPROGRAMFILES%\Microsoft shared\Web server extensions\12\Bin. (Because, STSADM.EXE sits in this folder )

Execute the following command from the above location

Stsadm –o installfeature –filename SabinsNewFeature\feature.xml

You will get a message saying "Operation completed Successfully"

7. Activate the new feature by running the following command
stsadm –o activatefeature -filename SabinsNewFeature\feature.xml -url http://siteurl

if your site has been in the port,
stsadm –o activatefeature -filename SabinsNewFeature\feature.xml -url http://siteul:port number


Now you will see the new menu item in the "Site Settings" of the site that you installed the feature.

Friday, October 31, 2008

Best Practices for Writing HTML in Web Parts?

Something that's as puzzling as the Cadbury secret (and we all know that us programmers figured that out long ago) is just what's the best way to write out HTML in Web Parts? So call me masochistic but I write Web Parts with code. Yes, it's ugly. Yes, it's painful. Yes, you could use something cool like SmartPart or load the controls yourself (but that brings on a host of other issues like Code Access Security so we won't go into that).

For those of us that hold true to the "old fashioned" way, what's the best way to write all that code out? Consider these two approaches that writes out a label and control in a row for a form:

private void RenderRow(HtmlTextWriter output, Label label, WebControl control)

{

output.Write("");

label.RenderControl(output);

output.Write("");

control.RenderControl(output);

output.Write("");

}



private void RenderRow(HtmlTextWriter output, Label label, WebControl control)

{

output.RenderBeginTag("tr");

output.RenderBeginTag("td");

output.AddAttribute("class", "ms-formlabel");

output.AddAttribute("valign", "top");

output.AddAttribute("nowrap", "true");

label.RenderControl(output);

output.RenderEndTag();

output.RenderBeginTag("td");

output.AddAttribute("class", "ms-formbody");

control.RenderControl(output);

output.RenderEndTag();

output.RenderEndTag();

}



Both output exactly the same HTML. Does it matter? The first approach is less lines but is it any more (or less) readable? Or maybe everything should be built up in a StringBuilder class and slammed out to the HtmlTextWriter? Or is it simply whatever is readable or maintainable works? Looking for your thoughts, ideas, suggestions, rants, assorted concealed lizards of any kind.