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.

November 21, 2011

The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contac

Sometimes, while executing an application in sharepoint environment, we get the following error.

The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. in sharepoint


This problem is basically related with the Trust Level. Just make the following changes in under element of the web.config file of the corresponding web application.


Change from,
< system.web >
< trust level="WSS_Minimal" originUrl="" / >

to in web.config

< system.web >

< trust level="Full" originUrl="" / >

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

< asp:HyperLink id="hlMySite" runat="server" / >

Add visible="false"

The above line will become < asp:HyperLink id="hlMySite" runat="server" visible="false" / >.

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

< asp:HyperLink ID="NewMySiteHyperlink" runat="server" Text="My World" Visible="true" NavigateUrl="http://your mysite Url/_layouts/MySite.aspx"/ >

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

< asp:HyperLink ID="NewMySiteHyperlink" runat="server" ImageUrl="/_LAYOUTS/ Link to your image file" Text="My World" Visible="true" NavigateUrl="http:// Your MySite Url/_layouts/MySite.aspx"/ >

October 11, 2011

Configuration Error : Web.Config [No Relevant Source Line]

Sometimes , we get the below error while running pages in Moss 2007


Solution : We have to grant the Full Control on the Security tab and for that right click the folder and select Properties.

Or

You have to place your project in the root drive of windows installation.



September 26, 2011

Display user image from user profiles in MOSS 2007

In MOSS 2007, by default the logged user image is not displayed on the aspx pages. In order to display the user image from user profiles in mysite, add the following code in the aspx pages , by editing the pages in sharepoint designer 2007.



In order to increase the picture size, increase the size of the "ResizetoFit " attribute value as per your requirement. Both the length and breadth will increase in the same proportion.

September 1, 2011

Browsers error in Sharepoint

Sometimes after making changes in Sharepoint website, we started to get the Browsers error in IE. Like the following error:



The solution to remove this error is to delete the App_Browsers folder in _vti_cnf of respective website in Inetpub.

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...