I’m trying to resize an image into a square thumbnail using ASP. The image should be sized as a percentage.
So say, for example: I had an image with a width of 25% in a browser window of 1000px, the width would be 250px, but because the image isn’t originally a square the height could be less or more than 250px.
Using jQuery I can fix this with the following:
window.onresize = function () {
var newheight = $("img").width();
$("img").css("height", newheight);
});
Is there any way to do the same in ASP, I’m new to ASP so excuse me for being noob-ish.
ASP.NET is running on the server-side, before the page is sent to the browser so has no idea of the browser parameters. As a result, you can’t do this in ASP.NET.