Load combos

Discussion in 'ASP .Net' started by =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?=, Jun 7, 2007.

  1. Hello,

    I have a list of entities (with properties Key and Description).

    Which is the best manner of load dropdownlist with this list ?

    1.

    ListaTiposInmueble tiposInmueble = bfll.ObtenerListaTiposInmueble();
    foreach (TipoInmuebleEntidad tipoInmueble in
    tiposInmueble.TiposInmueble.Values)
    {
    this.ddlTipoInmueble.Items.Add(new
    ListItem(tipoInmueble.Fcitem, tipoInmueble.Valor.ToString()));
    }

    2.

    //ListaTiposInmueble tiposInmueble =
    bfll.ObtenerListaTiposInmueble();
    //if (tiposInmueble != null)
    //{
    // this.ddlTipoInmueble.Items.Clear();
    // this.ddlTipoInmueble.DataSource =
    tiposInmueble.Elementos.Values;
    // this.ddlTipoInmueble.DataTextField = "Fcitem";
    // this.ddlTipoInmueble.DataValueField = "Valor";
    // this.ddlTipoInmueble.DataBind();
    //}

    Thanks in advance

    --
    http://www.alhambra-eidos.es/web2005/index.html
    www.kiquenet.net
     
    =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?=, Jun 7, 2007
    #1
    1. Advertising

  2. 2.

    In many cases you can also do it in .aspx page without codebehind.

    --
    Eliyahu Goldin,
    Software Developer & Consultant
    Microsoft MVP [ASP.NET]
    http://msmvps.com/blogs/egoldin
    http://usableasp.net


    "Alhambra Eidos Kiquenet" <>
    wrote in message news:...
    > Hello,
    >
    > I have a list of entities (with properties Key and Description).
    >
    > Which is the best manner of load dropdownlist with this list ?
    >
    > 1.
    >
    > ListaTiposInmueble tiposInmueble = bfll.ObtenerListaTiposInmueble();
    > foreach (TipoInmuebleEntidad tipoInmueble in
    > tiposInmueble.TiposInmueble.Values)
    > {
    > this.ddlTipoInmueble.Items.Add(new
    > ListItem(tipoInmueble.Fcitem, tipoInmueble.Valor.ToString()));
    > }
    >
    > 2.
    >
    > //ListaTiposInmueble tiposInmueble =
    > bfll.ObtenerListaTiposInmueble();
    > //if (tiposInmueble != null)
    > //{
    > // this.ddlTipoInmueble.Items.Clear();
    > // this.ddlTipoInmueble.DataSource =
    > tiposInmueble.Elementos.Values;
    > // this.ddlTipoInmueble.DataTextField = "Fcitem";
    > // this.ddlTipoInmueble.DataValueField = "Valor";
    > // this.ddlTipoInmueble.DataBind();
    > //}
    >
    > Thanks in advance
    >
    > --
    > http://www.alhambra-eidos.es/web2005/index.html
    > www.kiquenet.net
    >
     
    Eliyahu Goldin, Jun 7, 2007
    #2
    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. Mad Scientist Jr
    Replies:
    7
    Views:
    1,201
    Emma Gumbdough
    Jun 30, 2004
  2. venky

    Page Load and webcontrol page load

    venky, Jul 6, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    3,186
    venky
    Jul 11, 2005
  3. aaa

    How to filter two combos on grid clientside

    aaa, Apr 20, 2005, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    116
    Ken Cox [Microsoft MVP]
    Apr 21, 2005
  4. Laphan

    Big favour needed to test site combos

    Laphan, Aug 31, 2003, in forum: ASP General
    Replies:
    5
    Views:
    153
  5. Gordowey
    Replies:
    2
    Views:
    125
    Gordowey
    Aug 22, 2006
Loading...

Share This Page