C# & ASP.NET - March 2015

Enabling CORS only for specific domains in ASP.NET

Enable cross origin resquests only for certain domains in ASP.NET
0
Cross-origin resource sharing (CORS) means that page from other domain can make request to some resource which is on other domain. For example, if you try to invoke some WEB API method which is running on different domain you will get exception in the script. By default CORS are disabled in ASP.NET bot you can easily enable them just by modifying web.config for IIS7 and newer versions pf IIS. ... read more

Image thumbnail Html helper with image caching for the perforance

Creating image thumbnail with caching in MVC
0
Creating image thumbnail on the fly is pretty easy in ASP.NET whether you are still using WebForms or MVC. There is even a methods introduced in .NET 4.5 framework for generating thumbnail image from a Bitmap class instance. You can easily create and action in a controller and generate and return thumbnail image on the fly ... read more

Enabling compression on shared host

Compress your response on shared IIS hosts
0
HTTP compression is a simple way to improve site performance and decrease bandwidth, with no configuration required on the client side. If you test your website through Google PageSpeed Insights, HTTP compression will be one of the points recommended to be used to increase website performance. Luckily for .NET developers IIS supports it out of the box ... read more