I have an asp:Image and I'd like to be able to set the height of it.
However, the line below gets the error:
"Value of type 'Integer' cannot be converted to 'System.Web.UI.WebControls.Unit'
Image1.Height = 5
How on earth can you specify the height of it?
I've tried putting it in quotes, tried saying 5px, tried saying 5px in quotes etc... to no avail.
Any thoughts? I'd imagine I'll need to be able to do stuff like this rather soon, I'd rather figure it out sooner rather than later, I'd imagine it's fairly critical.
Cheers,
NeilYou're above line of code should work in C# / VS.NET 2003 but, this also works.
System.Web.UI.WebControls.Unit.Pixel(integergoeshere)
and instead of a "Pixle", you can use any unit you want, there is an enumeration of them.
0 comments:
Post a Comment