April 25, 2012

Change Text or Image of the MySite Link in Moss 2007

Sometimes the user wants to change the MySite Link text to something else like "My World". In that case, you can do that by making changes to the MySiteLink.ascx file. This MySiteLink.ascx file is located at
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES
Now, open that MySiteLink.ascx file in sharepoint designer and change the following line
Add visible="false"
The above line will become .

Now, finally to change the Mysite text add the following line with the text that you want to display. Here, i want to display "Hello".

To display image in place of MySite Text you can use the following line

Retriving URL Value of SharePoint Hyperlink Field


To get the value of a SharePoint hyperlink field in a custom list using the object model, we generally use.

SPList mylist = myweb.Lists[Your_ListName];
SPQuery rootQuery = new SPQuery();
rootQuery.Query = "";

SPListItemCollection lstitemcol = mylist.GetItems(rootQuery);

foreach (SPListItem lstitem in lstitemcol)
{
   string URL=lstitem[url_Column_Name].ToString();   
}

The above URL string will contains the value but the only problem with this URl string is that  it will contains two URL’s separated by a comma. This is because one is the actual display text for the field and the other is the value (the actual URL itself).

In order to get just the URL value, you need to use the following object model code:

SPFieldUrlValue rootUrl = new SPFieldUrlValue(lstitem[Column_Name].ToString());
string URL = rootUrl.Url;

You can also use value.Description to get the actual display text for the field.

Error installing .Net Framework 3.5 in Sql Server 2012

During installation of Sql Server 2012 on Windows server 2012 or addition of roles and features for SharePoint 2013, the setup wizard will...