Microsoft Content Management Server - Custom ImagePlaceholder...Want to maintain aspect ratio of image, and make image click

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > July 2004 > Custom ImagePlaceholder...Want to maintain aspect ratio of image, and make image click





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Custom ImagePlaceholder...Want to maintain aspect ratio of image, and make image click
Alan Taylor

2004-07-28, 6:10 pm

Hi,

I've written a custom image placeholder. I've overridden the Render
method, and have so far I've managed to write code to make the image
clickable, so that it the full image is shown in a new window, see
code below.

The problem is that the image shown on the posting isn't shown with
the correct aspect ratio. How might I do this? The ImagePlaceholder
doesn't have Height or Width properties?


protected override void Render(HtmlTextWriter writer)
{
ImagePlaceholder pImage = this.BoundPlaceholder as ImagePlaceholder;

writer.Write("<a href='" + pImage.Src + "' target='_blank'><img
src='" + pImage.Src + "' alt='" + pImage.Alt + "'</a> ");

}

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com