Archive

Posts Tagged ‘customise’

Format Date and Time

Format date and time :

m_CalculatedOutOfOfficeStartDate = outOfOfficeStartDate.ToString("dd/MM/yyyy");
m_CalculatedOutOfOfficeEndDate = outOfOfficeEndDate.ToString("dd/MM/yyyy");

Hope this helps-
Rehman.

Ensure trailing slash

Sometimes you don’t know if you’ll get a trailing slash or not with a web.Url or site.Url. Use the method:

public static string EnsureTrailingSlash(string strUrl)
        {
            if (!strUrl.EndsWith("/", StringComparison.OrdinalIgnoreCase))
            {
                strUrl += "/";
            }
            return strUrl;
        }

Call like this:
SharedUrlUtility.EnsureTrailingSlash(SharedUserProfiles.MySiteHostUrl);

Hope this helps-
Rehman.

Hide Site Actions


<!--Hide Site Actions from readers/visitors -->

<Sharepoint:SPSecurityTrimmedControl runat="server" Permissions="EditListItems">

<!-- Site Actions content here... -->

</Sharepoint:SPSecurityTrimmedControl>

Hope this helps-
Rehman.

Enable BI Center as a subsite

August 4, 2011 Leave a comment

Enabling the following features at a team site collection will allow you to create a BI Centre as a subsite to it.

Site -> Site Actions -> Site Collections Administration -> Site Collection Features -> SharePoint Server Publishing Infrastructure

Site -> Site Settings -> Site collection administration -> Site Collection Features -> PerformancePoint Services Site collection features

Site -> Site Settings -> Site Features -> PerformancePoint Services Site Features

Hope this helps–
Rehman.

Performance Point – “Code blocks are not allowed”

When you try to launch performance point designer you get “An error occurred during the processing of /mysitecollection/pages/ppssample.aspx. Code blocks are not allowed in this file” ….

Go to your web.config and add the following:

<PageParserPaths>
	<PageParserPath VirtualPath="/mysitecollection/Pages/ppssample.aspx" CompilationMode="Always" AllowServerSideScript="true" />
</PageParserPaths>

Hope this helps–
Rehman.

Javascript from within CSharp

This is how you can write javascript from within c#:

if (dtStart.SelectedDate != dtEnd.SelectedDate)
			{
			    Response.Write(@"<script language='javascript'>alert('Start date must be equal to end date. Only hours and minutes can be different.');</script>");
			}

Hope this helps-
Rehman.

SharePoint 2010 .. What can it do?

This:

Collaboration
Portal
Enterprise Content Mgmt
Search
Workflows
Web Pages
Social Computing
Business Intelligence
Composite Applications

more or less.

Hope this helps-
Rehman.