473,386 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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
8 4011
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Zach | last post by:
i have code using pixel to define how i want preview image to appear when someone does rollover on one of my menus (css menu code from eric meyer!) and i cannot figure out how to make the image...
9
by: Veerle | last post by:
Hi, I would like to divide the whole of my html page in 4 equal rectangles using only div tags in my html. The result should look a bit like this site:...
9
by: SteFetS | last post by:
Hi, I have a webapplication (asp.net) Snippet: Dim Img As New System.Web.UI.WebControls.Image Img.ID = "Image1" Img.ToolTip = "Trou" Img.ImageUrl = "http://localhost/images/0.bmp"...
15
by: David Lozzi | last post by:
Howdy, I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders! Now I am making a public function that will take the...
7
by: Dave Keen | last post by:
Hi I am a relative newcomer and as usual I am stuck. My ASP.Net 2003 app has a page which shows data from a database plus an associated picture. I use an ASP image control sized to 300x300px. ...
0
by: benfly08 | last post by:
Hi, guys. I have a program to draw bar/pie chart based on the data i hard coded in it. However, my image comes with "BLACK" background color. I don't know how to fix this. The code snippet is...
33
by: STILL LEARNING | last post by:
I'm not sure if this can even be done, but what prompts the question is my desire to be able to create an "Uber Link" script/code of some sort, such that even if the html page contains nothing but...
7
crystal2005
by: crystal2005 | last post by:
Hi all, I'm currenty creating a website. I got one confusing problem related to CSS and JavaScript actually, not really html. The problem is, I actually want my welcome screen page is to be random...
0
by: punitshrivastava | last post by:
Hi to All, I am Punit Shrivastava.i created one html page for this i cde like this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.