Items added to list box with client side script not present on postback

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

    Items added to list box with client side script not present on postback

    In an ASP.NET web application, I am using the standard list box server control and I am adding items to with client side script. When the page posts back, the added items are not available on the server.

    What do I have to do to make the items available on the server after a post back

  • Jim M

    #2
    Re: Items added to list box with client side script not present on postback

    I guess that would make sense if you think about it. Once the page is
    rendered, there is no communication back to the server.

    You either have to deal with the post back each time or be a bit more
    creative.

    How about sending a quick note to the server from javascript to fill a
    database on the server side... Maybe someone else has a method of getting
    the contents of the drop down on the server and then re-writing it.

    My method is a bit messy, but makes for a clean user interface.... I keep
    the data for the drop down in a database on the server and update the server
    each time I update the drop down on the client side..

    s_xml stores a small xml dataset for the one item that is added

    var xml_http = new ActiveXObject(" Microsoft.XMLHT TP");

    var xmlSend_doc = new ActiveXObject(" Microsoft.XMLDO M")
    xmlSend_doc.asy nc = false;

    xmlBack_doc.asy nc = false;
    xmlSend_doc.loa dXML(s_xml)

    "Bill Manring" <bill.manring@w avefrontsoftwar e.com> wrote in message
    news:FFCF9848-AC21-4A07-BFBF-91BB6804F8A4@mi crosoft.com...[color=blue]
    > In an ASP.NET web application, I am using the standard list box server[/color]
    control and I am adding items to with client side script. When the page
    posts back, the added items are not available on the server.[color=blue]
    >
    > What do I have to do to make the items available on the server after a[/color]
    post back?[color=blue]
    >[/color]


    Comment

    • Jim M

      #3
      Re: Items added to list box with client side script not present on postback

      I guess that would make sense if you think about it. Once the page is
      rendered, there is no communication back to the server.

      You either have to deal with the post back each time or be a bit more
      creative.

      How about sending a quick note to the server from javascript to fill a
      database on the server side... Maybe someone else has a method of getting
      the contents of the drop down on the server and then re-writing it.

      My method is a bit messy, but makes for a clean user interface.... I keep
      the data for the drop down in a database on the server and update the server
      each time I update the drop down on the client side..

      s_xml stores a small xml dataset for the one item that is added

      var xml_http = new ActiveXObject(" Microsoft.XMLHT TP");

      var xmlSend_doc = new ActiveXObject(" Microsoft.XMLDO M")
      xmlSend_doc.asy nc = false;

      xmlBack_doc.asy nc = false;
      xmlSend_doc.loa dXML(s_xml)

      "Bill Manring" <bill.manring@w avefrontsoftwar e.com> wrote in message
      news:FFCF9848-AC21-4A07-BFBF-91BB6804F8A4@mi crosoft.com...[color=blue]
      > In an ASP.NET web application, I am using the standard list box server[/color]
      control and I am adding items to with client side script. When the page
      posts back, the added items are not available on the server.[color=blue]
      >
      > What do I have to do to make the items available on the server after a[/color]
      post back?[color=blue]
      >[/color]


      Comment

      Working...