is the value passed via HiddenField to client-side always string?

Discussion in 'ASP .Net Web Controls' started by André, Jun 17, 2006.

  1. André

    André Guest

    Hi,

    I want to pass a integer value to client-side via a hiddenfield created in
    the aspx (HiddenField1)

    dim myvalue as integer
    myvalue=5
    HiddenField1=myvalue

    When fetching in Javascript, the value is of type string.
    var myvalue=document.getElementById("HiddenField5").value

    Is this by default? Do i have to parseInt each value passed?

    Thanks
    André
     
    André, Jun 17, 2006
    #1
    1. Advertising

  2. *Everything* in an HTML document is text. So, yes, you do.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    Professional Chicken Salad Alchemist

    I recycle.
    I send everything back to the planet it came from.

    "André" <> wrote in message
    news:...
    > Hi,
    >
    > I want to pass a integer value to client-side via a hiddenfield created in
    > the aspx (HiddenField1)
    >
    > dim myvalue as integer
    > myvalue=5
    > HiddenField1=myvalue
    >
    > When fetching in Javascript, the value is of type string.
    > var myvalue=document.getElementById("HiddenField5").value
    >
    > Is this by default? Do i have to parseInt each value passed?
    >
    > Thanks
    > André
    >
    >
     
    Kevin Spencer, Jun 17, 2006
    #2
    1. Advertising

  3. André

    André Guest

    Thanks

    "Kevin Spencer" <> wrote in message
    news:...
    > *Everything* in an HTML document is text. So, yes, you do.
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > Professional Chicken Salad Alchemist
    >
    > I recycle.
    > I send everything back to the planet it came from.
    >
    > "André" <> wrote in message
    > news:...
    > > Hi,
    > >
    > > I want to pass a integer value to client-side via a hiddenfield created

    in
    > > the aspx (HiddenField1)
    > >
    > > dim myvalue as integer
    > > myvalue=5
    > > HiddenField1=myvalue
    > >
    > > When fetching in Javascript, the value is of type string.
    > > var myvalue=document.getElementById("HiddenField5").value
    > >
    > > Is this by default? Do i have to parseInt each value passed?
    > >
    > > Thanks
    > > André
    > >
    > >

    >
    >
     
    André, Jun 17, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. André
    Replies:
    2
    Views:
    416
    André
    Jun 17, 2006
  2. Anand
    Replies:
    2
    Views:
    928
    Anand
    Sep 11, 2003
  3. sklett

    HiddenField value not valid

    sklett, Oct 13, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    448
    Robert Haken [MVP]
    Oct 13, 2006
  4. Jeff
    Replies:
    3
    Views:
    773
  5. RSH
    Replies:
    1
    Views:
    667
    Thomas Hansen
    Apr 10, 2007
Loading...

Share This Page