Software Squirrel
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";
}
<td colspan="4">
<asp:Image ID="imgLogo" runat="server" CssClass="posterLogo" AlternateText="Logo" />
</td>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER