html image percentage issue

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default 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.
    Chris Guest

  2. Similar Questions and Discussions

    1. JavaScript issue after exporting HTML from Fireworks
      I have been using Fireworks MX 2004 to create a web page with pop-ups, slice it and export it to HTML. In Dreamweaver MX 2004 I would then add a...
    2. Possible Issue with HTML::TreeBuilder?
      I am having a problem deleting a temporary attribute from a HTML node. The XML spec that I am using allows a user to declare a table similar to...
    3. Printing image issue
      I upgraded from freehand 10 to mx and have a problem when printing a business card that was converted from version 10 to mx. All of the text looks...
    4. MX 2004 HTML Exporting Issue?
      I've created a site in Fireworks MX, created the rollovers, export the HTML and images and then import "Fireworks HTML" into DW MX; looks great! ...
    5. Image issue
      Which article are you referring to? Is it this one? http://www.dw-fw-beginners.com/tutorials/frwrks/bitmap_select.htm Cheers, Sam "jerush"...
  3. #2

    Default Re: html image percentage issue

    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 <chrisp@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: [url]http://www.opera.com/m2/[/url]
    Bill Priess Guest

  4. #3

    Default Re: html image percentage issue

    I get an error stating that unit cannot convert to an integer, on both of
    those attempts.


    "Bill Priess" <no.spam@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 <chrisp@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: [url]http://www.opera.com/m2/[/url]

    Chris Guest

  5. #4

    Default Re: html image percentage issue

    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
    [email]john.saunders@surfcontrol.com[/email]


    "Chris" <chrisp@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.spam@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 <chrisp@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: [url]http://www.opera.com/m2/[/url]
    >
    >

    John Saunders Guest

  6. #5

    Default Re: html image percentage issue

    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??

    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuihtmlcontrolshtmlimageclasswidthtop ic.asp[/url]



    "John Saunders" <john.saunders@surfcontrol.com> wrote in message news:<Ouy$DqWUDHA.2308@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
    > [email]john.saunders@surfcontrol.com[/email]
    >
    >
    > "Chris" <chrisp@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.spam@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 <chrisp@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: [url]http://www.opera.com/m2/[/url]
    > >
    > >
    Chris Guest

  7. #6

    Default Re: html image percentage issue

    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
    [email]john.saunders@surfcontrol.com[/email]

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    John Saunders Guest

  8. #7

    Default Re: html image percentage issue

    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" <john.saunders@surfcontrol.com> wrote in message
    news:e5PAL8dUDHA.1484@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
    > [email]john.saunders@surfcontrol.com[/email]
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Chris Guest

  9. #8

    Default Re: html image percentage issue

    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
    [email]john.saunders@surfcontrol.com[/email]

    "Chris" <chrisp@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" <john.saunders@surfcontrol.com> wrote in message
    > news:e5PAL8dUDHA.1484@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
    > > [email]john.saunders@surfcontrol.com[/email]
    > >
    > > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > > Don't just participate in USENET...get rewarded for it!
    >
    >

    John Saunders Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139