checkbox value attribute in checkbox control ?

Discussion in 'ASP .Net Web Controls' started by Imran Aziz, Aug 6, 2005.

  1. Imran Aziz

    Imran Aziz Guest

    Hello All,
    I am trying to use checkbox control but cannot seem to find an
    equivalent value attribute the way it exists in html controls. How can I
    then assign values to a checkbox control at runtime and then get it back
    later?
    Imran.
    Imran Aziz, Aug 6, 2005
    #1
    1. Advertising

  2. Imran Aziz

    Teemu Keiski Guest

    Hi,

    basically you could add value via Attributes collection of the checkbox

    chk.Attributes["value"] = "something";

    or you could just use HTML server control (as you hinted)

    <input id="mycheckbox" runat="server" value="testvalue" type="checkbox"
    />Test text

    --
    Teemu Keiski
    ASP.NET MVP, AspInsider
    Finland, EU
    http://blogs.aspadvice.com/joteke


    "Imran Aziz" <> wrote in message
    news:...
    > Hello All,
    > I am trying to use checkbox control but cannot seem to find an
    > equivalent value attribute the way it exists in html controls. How can I
    > then assign values to a checkbox control at runtime and then get it back
    > later?
    > Imran.
    >
    Teemu Keiski, Aug 7, 2005
    #2
    1. Advertising

  3. Imran Aziz

    Imran Aziz Guest

    Thanks a lot Teemu, that was wonderful, I will try using the attributes
    collection to get that done.
    Imran.
    "Teemu Keiski" <> wrote in message
    news:ut$...
    > Hi,
    >
    > basically you could add value via Attributes collection of the checkbox
    >
    > chk.Attributes["value"] = "something";
    >
    > or you could just use HTML server control (as you hinted)
    >
    > <input id="mycheckbox" runat="server" value="testvalue" type="checkbox"
    > />Test text
    >
    > --
    > Teemu Keiski
    > ASP.NET MVP, AspInsider
    > Finland, EU
    > http://blogs.aspadvice.com/joteke
    >
    >
    > "Imran Aziz" <> wrote in message
    > news:...
    >> Hello All,
    >> I am trying to use checkbox control but cannot seem to find an
    >> equivalent value attribute the way it exists in html controls. How can I
    >> then assign values to a checkbox control at runtime and then get it back
    >> later?
    >> Imran.
    >>

    >
    >
    Imran Aziz, Aug 8, 2005
    #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. Replies:
    2
    Views:
    1,060
    Henry S. Thompson
    Mar 6, 2006
  2. Replies:
    1
    Views:
    4,219
    Joe Kesselman
    Aug 2, 2006
  3. Replies:
    8
    Views:
    509
  4. bprimuslevy
    Replies:
    1
    Views:
    421
    Soren Kuula
    Aug 23, 2006
  5. Stefan_W
    Replies:
    1
    Views:
    8,138
    Stefan_W
    Nov 5, 2008
Loading...

Share This Page