If you're working with ASP.NET Web Pages, Web Forms or MVC no matter what type of technology you're using. You can use the
WebImage
object and work with it.
It has many built-in functions that you can use, to resize or to do what so ever you want to do.
http://www.asp.net/web-pages/tutorials/files,-images,-and-media/9-working-with-images[
^] Use this link, to learn this from the official ASP.NET website.
.. or you can learn it from the MSDN :
http://msdn.microsoft.com/en-us/library/system.web.helpers.webimage(v=vs.111).aspx[
^]
Sample code to deal with it is as:
var photo = new WebImage().GetImageFromRequest();
photo.Resize(width: 60, height: 60, preserveAspectRatio: true,
preventEnlarge: true);
Also remember, FileUpload control in the ASP.NET Web Pages NuGet helper also converts the entire code to the HTML code.