Archive for January 30, 2012

HTML Redirect

The HTML redirect allows to introduce a delay before the redirection is performed. It is sometimes called “META refresh” redirect.

Browsers will display the page during the specified time and then move forward to the page pointed to by the redirection.

HTML Redirect and Search Engines

We will specifically look at how Google handles HTML redirections. There are two cases :

– the delay is very short (0, 1 or 2 seconds)

The redirecting page is displayed so briefly that some users might not even notice its presence. Google decides that the content of this page should not be indexed and that the link should be handled as a redirection.

Google method to decide about the preferred URL seems to be similar to its processing of 302 redirections.

– the delay is long enough (3 seconds or more)

The redirecting page is clearly visible to most users. Google will index both the redirecting page as well as the page pointed to by the redirection.

HTML Redirect Source Code





The redirecting page will be displayed during 5 seconds. After this 5 seconds delay, it will be replaced by “the-other-page.html”.


The redirecting page will be displayed during 12 seconds. After this 12 seconds delay, it will be replaced by the home page of this site.


The redirecting page will be displayed and immediately replaced by “another-page.html”. With this zero-delay, many users will not even notice the presence of the redirecting page.

Retrieve value from SPFieldMultiLineText field in SharePoint

 

SPSite site = new SPSite("http://{yoursite}")) 
{
using (SPWeb web = site.OpenWeb())
{

SPList list = web.Lists["{YourList}"];
SPListItem result = list.GetItemById(1);
SPFieldMultiLineText commentsField = result.Fields.GetField("Comments") as SPFieldMultiLineText;

string comments = commentsField .GetFieldValueAsText(result["Comments"]);
string commentsAsHtml = commentsField .GetFieldValueAsHtml(result["Comments"]);
}
}