About DropDownList Question !!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul

    #1

    About DropDownList Question !!

    Hi there,

    I can use the method DropDownList1.I tems.Add("test" ) to add data to the
    dropdownlist control.
    But how should I do if I want to insert the control property TEXT is "test"
    and the VALUE is "1".
    Thanks !!

    --
    Paul


  • Arild Bakken

    #2
    Re: About DropDownList Question !!

    "Paul" <mjt@seed.net.t w> wrote in message
    news:%23DizCs0i DHA.1668@TK2MSF TNGP12.phx.gbl. ..[color=blue]
    > Hi there,
    >
    > I can use the method DropDownList1.I tems.Add("test" ) to add data to the
    > dropdownlist control.
    > But how should I do if I want to insert the control property TEXT is[/color]
    "test"[color=blue]
    > and the VALUE is "1".
    > Thanks !!
    >
    > --
    > Paul[/color]

    Use the other Add method:

    DropDownList1.I tems.Add(new ListItem("text" , "value"));

    Arild


    Comment

    • Arild Bakken

      #3
      Re: About DropDownList Question !!

      "Paul" <mjt@seed.net.t w> wrote in message
      news:%23DizCs0i DHA.1668@TK2MSF TNGP12.phx.gbl. ..[color=blue]
      > Hi there,
      >
      > I can use the method DropDownList1.I tems.Add("test" ) to add data to the
      > dropdownlist control.
      > But how should I do if I want to insert the control property TEXT is[/color]
      "test"[color=blue]
      > and the VALUE is "1".
      > Thanks !!
      >
      > --
      > Paul[/color]

      Use the other Add method:

      DropDownList1.I tems.Add(new ListItem("text" , "value"));

      Arild


      Comment

      Working...