Skip to main content

Posts

Best Practices for Speeding Up Your Web Site

This article is a copy of a Yahoo Developer article , the Exceptional Performance team has identified a number of best practices for making web pages fast. The list includes 35 best practices divided into 7 categories. Filter by category: Content Server Cookie CSS JavaScript Images Mobile All Minimize HTTP Requests tag: content 80% of the end-user response time is spent on the front-end. Most of this time is tied up in downloading all the components in the page: images, stylesheets, scripts, Flash, etc. Reducing the number of components in turn reduces the number of HTTP requests required to render the page. This is the key to faster pages. One way to reduce the number of components in the page is to simplify the page's design. But is there a way to build pages with richer content while also achieving fast response times? Here are some techniques for reducing the number of HTTP requests, while still supporting rich page designs. Combined files are a way to redu...

Get attachment with attachment icon

Recently I have a implemented a functionality in a SharePoint project, Get the attachment from a SharePoint list with a icon according to the type of attachement. After long practice we are able to resolve the same. Now I am sharing you the solution with you, I think it would help to you. Javascript Methods var SiteURL = ''; function getAttachments(ID,ListName) { var PageURL = window.location.href; var LastIndexOfPage = PageURL.substring(PageURL.lastIndexOf("/")); PageURL += "/"; SplitLastIndexOfPage = LastIndexOfPage.split("/"); var FirstIndexOfPage = PageURL.split("/"+SplitLastIndexOfPage[1]+"/"); //var lists = new SPAPI_Lists('http://sharepointdev:123/sites/myteamsite/phases/'); SiteURL = FirstIndexOfPage[0]; var lists = new SPAPI_Lists(SiteURL); var items = lists.getAttachmentCollection(ListName,ID); if (items.status == 200) { var rows = items.responseXML.getElementsByTagName('Attachment'); v...

Resolve 'SPAPI_Lists' is undefined

Problem: 'SPAPI_Lists' is undefined Cause: You forget to attach reference of SPAPI_Core.js and SPAPI_Lists.js. Resolution: Services JS API Includes Required Lists.asmx SPAPI_Core.js SPAPI_Lists.js Copy the SPAPI_Core.js and SPAPI_Lists.js to your application inside folder and include reference of SPAPI_Core.js and SPAPI_Lists.js to your page inside head tag. e.g

SharePoint Tip / Thought of the Day WebPart

I have posted a new web part on codeplex a brief description is provided below URL: http://tod.codeplex.com/ The "Thought / Tip of the Day" Web Part selects a random item from the specified SharePoint Custom List or a selected RSS Feed and displays a picture, a title and a thought/tip. The Web Part can be used with WSS 3.0, MOSS 2007 and SharePoint 2010. You can configure the following web part properties: • the SharePoint list containing the thoughts / tips • RSS Feed URL for external thoughts / tips • the List fields corresponding to the picture, title and thoughts / tips • a picture (Optional) • show a new thoughts / tips every day or on every page refresh This allows you to display random data contained in any SharePoint List by specifying the desired SharePoint List name and the desired list column names. Installation Instructions: 1. download the Thought / Tip of the Day Web Part wsp file 2. Install the wsp file and deploy to server farm. 3. If y...

Importing documents from SQL Server to Document Library

Recently I had come across a requirement where we had to migrate a existing SQL server tables data to a document library. The SQL table was containing documents (blob field and its meta data) i wanted to share with you all the small script we had used for the same string connstr = @”Data Source=.;Initial Catalog=AdventureWorks;Persist Security Info=True;User ID=sa;Password=sa”; SqlConnection conn = new SqlConnection(connstr); conn.Open(); SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = new SqlCommand(“SELECT * FROM [dbo].[ImageStore]“, conn); DataSet ds= new DataSet(); da.Fill(ds); byte [] blob = ( byte [])ds.Tables[0].Rows[0][ "imageContent" ]; using (SPSite destinationSite = new SPSite( "http://YourSite" )) { using (SPWeb = destinationSite.OpenWeb( "http://YourSite" )) { SPList destinationDocuments = destinationWeb.Lists[ "Documents" ]; string fileName = "mydoc.jpg" ; string relativeDestinationUrl = des...

SharePoint Interview Questions

1) What are the two base classes a WebPart you are going to use within SharePoint 2007 can inherit from? There are two base classes that a WebPart which is going to be consumed by SharePoint can inherit from, either the SharePoint WebPart Base class or the ASP.NET 2.0 WebPart base class. When inheriting from the SharePoint WebPart Base class your derived WebPart class will inherit from Microsoft.SharePoint.WebPartPages.WebPart. When inheriting from the ASP.NET 2.0 WebPart base class your derived WebPart class will inherit from System.Web.UI.WebControls.WebParts.WebPart. It is considered good practice to use the ASP.NET WebPart base class since the old base class is meant for backwards compatibility with previous version of SharePoint, however there are four exception when it is better to leverage functionality from the SharePoint WebPart base class: Cross page connections Connections between Web Parts that are outside of a Web Part zone Client-side connections (Web Part Page Services C...