467,915 Members | 1,171 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,915 developers. It's quick & easy.

html image percentage issue

I am unable display an image by percent. No matter what method I try,
I receive the following error.

Input string was not in the correct format.

No matter what method I use, I cannot get this to show up in a percent
format. What am I missing here.

currentStatusImage.Src = "../builds/images/green.gif"
currentStatusImage.Width = "60%"

Thanks.
Nov 17 '05 #1
  • viewed: 3844
Share:
8 Replies
currentStatusImage.Width is expecting a Unit, not a string, so you need to
do a Unit.Parse("60%") or a Unit.Percentage(60).

HTH,

Bill Priess

On 23 Jul 2003 13:29:33 -0700, Chris <ch****@webpositive.com> wrote:
I am unable display an image by percent. No matter what method I try,
I receive the following error.

Input string was not in the correct format.

No matter what method I use, I cannot get this to show up in a percent
format. What am I missing here.

currentStatusImage.Src = "../builds/images/green.gif"
currentStatusImage.Width = "60%"

Thanks.


--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 17 '05 #2
I get an error stating that unit cannot convert to an integer, on both of
those attempts.
"Bill Priess" <no*****@nospam.com> wrote in message
news:oprsr572hkcimqky@localhost...
currentStatusImage.Width is expecting a Unit, not a string, so you need to
do a Unit.Parse("60%") or a Unit.Percentage(60).

HTH,

Bill Priess

On 23 Jul 2003 13:29:33 -0700, Chris <ch****@webpositive.com> wrote:
I am unable display an image by percent. No matter what method I try,
I receive the following error.

Input string was not in the correct format.

No matter what method I use, I cannot get this to show up in a percent
format. What am I missing here.

currentStatusImage.Src = "../builds/images/green.gif"
currentStatusImage.Width = "60%"

Thanks.


--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

Nov 17 '05 #3
From the documentation:

HtmlImage.Width Property

Gets or sets the width of the image.

Public Property Width As Integer

Property Value

The width of the image.

--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"Chris" <ch****@webpositive.com> wrote in message
news:1058997574.400832@sj-nntpcache-5...
I get an error stating that unit cannot convert to an integer, on both of
those attempts.
"Bill Priess" <no*****@nospam.com> wrote in message
news:oprsr572hkcimqky@localhost...
currentStatusImage.Width is expecting a Unit, not a string, so you need to do a Unit.Parse("60%") or a Unit.Percentage(60).

HTH,

Bill Priess

On 23 Jul 2003 13:29:33 -0700, Chris <ch****@webpositive.com> wrote:
I am unable display an image by percent. No matter what method I try,
I receive the following error.

Input string was not in the correct format.

No matter what method I use, I cannot get this to show up in a percent
format. What am I missing here.

currentStatusImage.Src = "../builds/images/green.gif"
currentStatusImage.Width = "60%"

Thanks.


--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/


Nov 17 '05 #4
It does, the sdk also states that you can also set the value as a
percentage. The problem is that it doesn't give an example or any
detail to that.

"By default, the Width property is expressed in pixels, but it can
also be expressed as a percentage of the window size." - straight from
the windows sdk, and that's all it has to say about it. But how??

http://msdn.microsoft.com/library/de...widthtopic.asp

"John Saunders" <jo***********@surfcontrol.com> wrote in message news:<Ou**************@TK2MSFTNGP12.phx.gbl>...
From the documentation:

HtmlImage.Width Property

Gets or sets the width of the image.

Public Property Width As Integer

Property Value

The width of the image.

--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"Chris" <ch****@webpositive.com> wrote in message
news:1058997574.400832@sj-nntpcache-5...
I get an error stating that unit cannot convert to an integer, on both of
those attempts.
"Bill Priess" <no*****@nospam.com> wrote in message
news:oprsr572hkcimqky@localhost...
currentStatusImage.Width is expecting a Unit, not a string, so you need to do a Unit.Parse("60%") or a Unit.Percentage(60).

HTH,

Bill Priess

On 23 Jul 2003 13:29:33 -0700, Chris <ch****@webpositive.com> wrote:

> I am unable display an image by percent. No matter what method I try,
> I receive the following error.
>
> Input string was not in the correct format.
>
> No matter what method I use, I cannot get this to show up in a percent
> format. What am I missing here.
>
> currentStatusImage.Src = "../builds/images/green.gif"
> currentStatusImage.Width = "60%"
>
> Thanks.
>

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/


Nov 17 '05 #5
It seems you've found a documentation error.

An integer is an integer, not a Unit. You can't use percentage in an
HtmlImage.

John Saunders
jo***********@surfcontrol.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #6
It seems you've found a documentation error.

An integer is an integer, not a Unit. You can't use percentage in an
HtmlImage.

John Saunders
jo***********@surfcontrol.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #7
Any ideas on how to get around this. In addition to this being an issue,
when I attempt to do the following ( going back to my asp classic way of
thinking ) :

<img border="0" id="currentStatusImage" src="<% = srcInfo %> width="<% =
widthInfo %>%" height="6" runat="server">

I still get the integer error. I'd rather not make this a static image but,
the list of ideas grows smaller. Thanks.
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:e5**************@TK2MSFTNGP12.phx.gbl...
It seems you've found a documentation error.

An integer is an integer, not a Unit. You can't use percentage in an
HtmlImage.

John Saunders
jo***********@surfcontrol.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 17 '05 #8
You're still getting the error because you've still got the control marked
as runat="server", which means it's an HtmlImage, which means that the Width
property is an integer.

Do you really need the image to be a server control?

And why not use style="WIDTH:100%" :

currentStatusImage.Style["WIDTH"] = "100%"

--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

"Chris" <ch****@webpositive.com> wrote in message
news:1059061676.370476@sj-nntpcache-3...
Any ideas on how to get around this. In addition to this being an issue,
when I attempt to do the following ( going back to my asp classic way of
thinking ) :

<img border="0" id="currentStatusImage" src="<% = srcInfo %> width="<% =
widthInfo %>%" height="6" runat="server">

I still get the integer error. I'd rather not make this a static image but, the list of ideas grows smaller. Thanks.
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:e5**************@TK2MSFTNGP12.phx.gbl...
It seems you've found a documentation error.

An integer is an integer, not a Unit. You can't use percentage in an
HtmlImage.

John Saunders
jo***********@surfcontrol.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 17 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Zach | last post: by
9 posts views Thread by Veerle | last post: by
9 posts views Thread by SteFetS | last post: by
7 posts views Thread by Dave Keen | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.