ComboBox

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

    #1

    ComboBox

    Hi,

    I have an ASP.NET form that includes several combo Boxes.
    The first Combo is loaded with items on Page_load.
    The second depends on the item selected on the first, the third on the
    second and so on.

    I don't want to transfer all the data needed with the form and also want to
    avoid page refresh on every item change.

    What is the best method for doing this?
    I heard about xmlhttp and WS but I don't know if any of those technologies
    is appropriate and how to use them in the project.

    Samples will help me very much.

    10X.


  • Kevin Spencer

    #2
    Re: ComboBox

    If I understand you correctly, you've just ruled out the only 2
    possibilities you have. Think about it. The data to populate the combo boxes
    is stored on the server. Therefore, you either have to (1) pass it all to
    the client to avoid having to PostBack, or (2) PostBack to get the data. If
    you can think of a third way, you're probably due the Nobel Prize!

    HTH,

    Kevin Spencer
    Microsoft FrontPage MVP
    Internet Developer
    All hotels in Benidorm. The best selection of Benidorm hotels with reviews and maps. Book in advance and save.

    Big things are made up of
    lots of Little things.

    "Tamir Berger" <tberger@kpmg.c om> wrote in message
    news:O4LY4gwODH A.1364@TK2MSFTN GP10.phx.gbl...[color=blue]
    > Hi,
    >
    > I have an ASP.NET form that includes several combo Boxes.
    > The first Combo is loaded with items on Page_load.
    > The second depends on the item selected on the first, the third on the
    > second and so on.
    >
    > I don't want to transfer all the data needed with the form and also want[/color]
    to[color=blue]
    > avoid page refresh on every item change.
    >
    > What is the best method for doing this?
    > I heard about xmlhttp and WS but I don't know if any of those technologies
    > is appropriate and how to use them in the project.
    >
    > Samples will help me very much.
    >
    > 10X.
    >
    >[/color]


    Comment

    • Tom Johnson

      #3
      Re: ComboBox

      Hello

      you could also use the webservice behavior to obtain the new info and
      transorm it with xsl to a <select>. or with the xmlhttp object...

      other idea?



      "Anatoly" <anatolyr@gilat .com> a écrit dans le message de
      news:%23tEw0gxO DHA.2224@TK2MSF TNGP10.phx.gbl. ..[color=blue]
      > We are using a hidden iframe for this
      > 1)Put an IFRAME with style="display: none" in this web form.
      > 2)On combo change(client-side) write something like this:
      >
      > frmServerSide.l ocation.href =
      > 'serverSide.asp x?Function=Fill CompanyCombo&cb oRegion=' +
      > document.frmCas eList.cboRegion .value + '&defaultCompan y=' +[/color]
      defaultCompany;[color=blue]
      >
      > where frmServerSide is name of IFRAME
      >
      > 3)in serverSide.aspx write on Page_Load() get the appropriate data (in
      > dataset for example) and do in loop
      >
      > Response.Write( "<script>")
      > Response.Write( " var oSelect = parent." + ComboName + "; ")
      > Response.Write( " var oOption; ")
      > //cleans the combo before filling
      > Response.Write( " while(oSelect.o ptions.length>0 ) ")
      > Response.Write( " oSelect.options .remove(0);")
      > foreach(DataRow Row in Data.Rows){
      > Response.Write( " oOption = document.create Element(""OPTIO N"");")
      > Response.Write( " oOption.text = '" + Row[TextField].ToString() +[/color]
      "';")[color=blue]
      > Response.Write( " oOption.value = '" + Row[ValueField] + "';")
      > Response.Write( " oSelect.add(oOp tion); ")
      > }
      >
      > ComboName is DropDownList.Cl ientId which you may pass from first form
      >
      > HTH
      >
      > "Tamir Berger" <tberger@kpmg.c om> wrote in message
      > news:O4LY4gwODH A.1364@TK2MSFTN GP10.phx.gbl...[color=green]
      > > Hi,
      > >
      > > I have an ASP.NET form that includes several combo Boxes.
      > > The first Combo is loaded with items on Page_load.
      > > The second depends on the item selected on the first, the third on the
      > > second and so on.
      > >
      > > I don't want to transfer all the data needed with the form and also want[/color]
      > to[color=green]
      > > avoid page refresh on every item change.
      > >
      > > What is the best method for doing this?
      > > I heard about xmlhttp and WS but I don't know if any of those[/color][/color]
      technologies[color=blue][color=green]
      > > is appropriate and how to use them in the project.
      > >
      > > Samples will help me very much.
      > >
      > > 10X.
      > >
      > >[/color]
      >
      >[/color]


      Comment

      Working...