Custom ImagePlaceholder...Want to maintain aspect ratio of image, and make image click
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > Custom ImagePlaceholder...Want to maintain aspect ratio of image, and make image click




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

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


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-28-04 11: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> ");

}






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 11:20 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register