Monday, August 13, 2012

Validate Image Type Using Image GUID in ASP.NET

http://www.codeproject.com/Tips/409328/Validate-Image-Type-Using-Image-GUID-in-ASP-NET

System.Drawing.Image image = System.Drawing.Image.FromStream(FileUpload1.FileContent);
        string FormetType = string.Empty;
        if (image.RawFormat.Guid == System.Drawing.Imaging.ImageFormat.Tiff.Guid)
            FormetType = "TIFF";
        else if (image.RawFormat.Guid == System.Drawing.Imaging.ImageFormat.Gif.Guid)
            FormetType = "GIF";
        else if (image.RawFormat.Guid == System.Drawing.Imaging.ImageFormat.Jpeg.Guid)
            FormetType = "JPG";
        else if (image.RawFormat.Guid == System.Drawing.Imaging.ImageFormat.Bmp.Guid)
            FormetType = "BMP";
        else if (image.RawFormat.Guid == System.Drawing.Imaging.ImageFormat.Png.Guid)
            FormetType = "PNG";
        else if (image.RawFormat.Guid == System.Drawing.Imaging.ImageFormat.Icon.Guid)
            FormetType = "ICO";
        else

A straightforward method to detecting RSS and Atom feeds in websites with HtmlAgilityPack

http://runtingsproper.blogspot.co.uk/2012/07/a-straightforward-method-to-detecting.html

Thursday, August 9, 2012

How to add http header into ASP.NET development server, Cassini, to change document mode in IE?

Add following line in Global.asax
        protected void Application_BeginRequest() {
            HttpContext.Current.Response.AddHeader("X-UA-Compatible", "IE=edge");
        }

Strongly Typed Data Controls and Modal Binding in ASP.NET 4.5

http://brijbhushan.net/2012/07/01/strongly-typed-data-controls-and-modal-binding-in-asp-net-4-5-part-1/

Strongly Typed Data Control