Popular Posts
JSON Foramter <html> <head>     <title>JSON Formater</title>     <style type="text/css">     body{         margin:... Wrong text encoding while Jsoup parse document While page encoding is different with content type encoding declaration. Jsoup will get wrong text decode content. To avoid this problem, As... Asynchronous and deferred JavaScript execution explained Normal execution <script> This is the default behavior of the <script> element. Parsing of the HTML code pauses while the scr...
Stats
Get file type icon path
/// <summary>
/// An item was added.
/// </summary>
public override void ItemAdded(SPItemEventProperties properties)
{
        var reportItem = properties.ListItem;
        // icon
        var icon = SPUtility.MapToIcon(properties.Web, reportItem["URL Path"].ToString(), "", IconSize.Size16);
        var iconPath = string.Format("/_layouts/15/images/{0}", icon);

        // do something
}