Link to home
Start Free TrialLog in
Avatar of Software Squirrel
Software SquirrelFlag for United States of America

asked on

Set an image size C#

I have a method that loads an image in my SharePoint user control.  I need to make the image stretch to fit the container.  Currently the image is too small.  I have tried this with in-line css and a style sheet.  Neither work. Is there an easy way to set the size of the image in C# to something like (width: 100%; height: 50px) ?  Here is what I have so far:
 public override void RenderControl(HtmlTextWriter writer)
        {
            imgLogo.ImageUrl = SPContext.Current.Site.Url + "/_layouts/images/Custom/PosterLogo.png";
}

Open in new window

<td colspan="4">
            <asp:Image ID="imgLogo" runat="server" CssClass="posterLogo" AlternateText="Logo" />  
        </td>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Rajar Ahmed
Rajar Ahmed
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Software Squirrel

ASKER

Perfect.