Same Old Question….Abstract Class & Interface

Abstract Class: Cannot be instantiated, contract that forces all the subclasses to carry on the same hierarchies or standards

Interface: No Implementation, When we create an interface, we are basically creating a set of methods without any implementation that must be overridden by the implemented classes

A class can implement more than one interface but can only inherit from one abstract class. Since C# doesn’t support multiple inheritance, interfaces are used to implement multiple inheritance.

When we create an abstract class, we are creating a base class that might have one or more completed methods but at least one or more methods are left uncompleted and declared abstract. If all the methods of an abstract class are uncompleted then it is same as an interface. The purpose of an abstract class is to provide a base class definition for how a set of derived classes will work and then allow the programmers to fill the implementation in the derived classes.


AJAX is a developer’s dream, because you can:

  • Update a web page without reloading the page
  • Request data from a server – after the page has loaded
  • Receive data from a server – after the page has loaded
  • Send data to a server – in the background


AJAX = Asynchronous JavaScript And XML.

AJAX is not a programming language.

AJAX just uses a combination of:

  • A browser built-in XMLHttpRequest object (to request data from a web server)
  • JavaScript and HTML DOM (to display or use the data)

AJAX allows web pages to be updated asynchronously by exchanging data with a web server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page.


Powershell script to export list view data to spreadsheet

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

$ListName = “Pipeline”
$ViewName = “All Items”

#Get Web and List objects
$web = Get-SPWeb $SiteURL
$list = $web.Lists[$ListName]

#Get the View
$view = $list.Views[$ViewName]

#Get All Items from the View
$items = $list.GetItems($view)
$view.rowlimit = 100000

#This will temporarily update the view row limit – it gets set back to 30 at the end of the script

foreach($vf in $vfields)
foreach($lf in $lfields)
if($lf.internalname -eq $vf)
$efields += $lf.title

$items = $list.getitems($view)
if($items.count -gt 0)
$exportlist = $null
$exportlist = @()
$items | foreach {
$hash = $null
$hash = @{}
foreach($ef in $efields)
$hash.add($ef, $_[$ef])
$obj = New-Object PSObject -Property $hash
$exportlist += $obj
foreach($efield in $efields)
$expath = ‘D:\ExportLV.csv’
$exportlist |select $sel | Export-Csv -path $expath -notypeinformation
$view.rowlimit = 30


SharePoint 2010 Calendar View: Hide End time, Remove ToolTip

Add a CEWP and add the below script as HTML Source.

// Created a new column on xRM Task list that concatenates the
// Due Date and Due Time into a single Date/Time field.
// Use the new Date/Time field in the Calendar view configuration as start/end date
// Use jQuery to:
// – change the monthly calendar time range displays (e.g., 3:30 pm – 3:30 pm)
// such that only a single time displays. There is no begin and end date/time
// field in the xRM Task list. Steve will use the Due Date and Due Time to track his activities.
// – Make the same change to tooltips.
// – link to edit form instead of display form. Return automatically to calendar
// the “populateCalendarEventLinkIntercept” technique came from Mike Smith:
// this technique handled all calendar view changes (day-week-month; previous/next)
// except the “n more Items” and “collapse” links when more than 3 items are on a month day.
// the setTimeout technique was suggested by Marc Anderson.
// it handles the more/collapse scenario
// load our function to the delayed load list
// but do not do this if page is in “Edit” mode


// hook into the existing SharePoint calendar load function
function populateCalendarEventLinkIntercept()

if (SP.UI.ApplicationPages.CalendarNotify.$4a) // 20111006 pre-SP1 – Office 365
var OldCalendarNotify = SP.UI.ApplicationPages.CalendarNotify.$4a;
SP.UI.ApplicationPages.CalendarNotify.$4a = function ()
if (SP.UI.ApplicationPages.CalendarNotify.$4b) // SP2010 SP1
var OldCalendarNotify = SP.UI.ApplicationPages.CalendarNotify.$4b;
SP.UI.ApplicationPages.CalendarNotify.$4b = function ()
// future service pack change may go here!
// if (SP.UI.ApplicationPages.CalendarNotify.???)

// }

function doModifyCal() {
// get text “Previous Month” or “…Week” or “…Day”
var dateUnit = $(“#AsynchronousViewDefault_CalendarView a[title^=’Previous’]”).filter(“:first”).attr(“title”);
// remove “Previous ” from text, leaving only “Month”, “Week” or “Day”
dateUnit=dateUnit.substring(dateUnit.indexOf(” “)+1);
// if there is a more/collapse control (which happens when there are more than three items on month date)
// set its click event to execute this doModifyCal function.
// include a pause to allow for latent data population from separate asynchronous thread
if ($(“”).eq(0).length) {
$(“”).eq(0).click(function() {
window.setTimeout(doModifyCal, 0);
// if there is at least one non-reformatted time display, clean it up
// A dash in the title signifies that this has not yet been reformatted
// well – not really. I’ll refine this later. The dash would have to be
// within the first 7 characters: hh:mm – hh:mm
var str=””;
var y=$(‘ div[title~=”-“]’).filter(“:first”);
if(y.length) {
var urlString = urlencode(location.href);
var CalData = $(‘’).eq(1);
$(‘div[title]’, CalData).each(function() {
str=str.slice(“-“)+2); // remove begin time from all link tool tips
if(dateUnit==”Month”) {
//check for and remove begin time from single-item-per-day times
$(“”).each(function() {

// additionally, replace the onclick action of each task item’s link such that a modal Edit form
// will pop up instead of modal Display form. This involves creating a new function that
// calls SP.UI.ModalDialog methods made available to SP2010 through the EcmaScript Client Object Model
// ref –
// do not include “more/collapse” link
// For clarification purposes we are going to:
// change this:
// task title
// to this:
// task title
var Links = $(“a:not(.ms-cal-nav)”, CalData);
Links.each(function() {
$(this).attr(“href”,”javascript:void();”).attr(“onclick”,”modalEdit(‘” + str + “‘);return(false);”);

function callBackRefresh(dialogResult, returnValue) {
var calDetail2 = $(“#AsynchronousViewDefault_CalendarView > > table”)

// We are here because someone clicked on a task item link in one of the
// calendar views.
function modalEdit(page) {
var options = {
url: page,
title: ‘Edit Task’,
allowMaximize: false,
showClose: true,
dialogReturnValueCallback: callBackRefresh,
autoSize: true
function urlencode(link) {
link = encodeURI(link);
link = link.replace(‘+’, ‘%2B’);
link = link.replace(‘%20’, ‘+’);
link = link.replace(‘*’, ‘%2A’);
link = link.replace(‘/’, ‘%2F’);
link = link.replace(‘@’, ‘%40’);
return link;