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

LVL 1
Christopher GoreSolutions ArchitectAsked:
Who is Participating?
 
Rajar AhmedConnect With a Mentor ConsultantCommented:
try this
imgLogo.Height = 200;
imgLogo.Width = 200;

Open in new window

0
 
Christopher GoreSolutions ArchitectAuthor Commented:
Perfect.
0
All Courses

From novice to tech pro — start learning today.