Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. combobox with postback

combobox with postback

Scheduled Pinned Locked Moved Web Development
helpannouncement
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shabonaa
    wrote on last edited by
    #1

    i have cobmobox (chapters_combo) with visible= true and another two combos with visible = false i want when selecting chapter1 from chapters_combo then make the first combo visible = true and selecting chapter2 from chapters_combo then make the second combo visible = true chapters_combo has autopostback = true the problem each time selecting an item from chapters_combo the whole page update. is there any way do overcome that. i tried to use Ajax updatepanel but it takes about 15 sec to show the combo.

    A J 2 Replies Last reply
    0
    • S shabonaa

      i have cobmobox (chapters_combo) with visible= true and another two combos with visible = false i want when selecting chapter1 from chapters_combo then make the first combo visible = true and selecting chapter2 from chapters_combo then make the second combo visible = true chapters_combo has autopostback = true the problem each time selecting an item from chapters_combo the whole page update. is there any way do overcome that. i tried to use Ajax updatepanel but it takes about 15 sec to show the combo.

      A Offline
      A Offline
      Adam Maras
      wrote on last edited by
      #2

      Look into using the ASP.NET AJAX CascadingDropDown control extender.

      S 1 Reply Last reply
      0
      • A Adam Maras

        Look into using the ASP.NET AJAX CascadingDropDown control extender.

        S Offline
        S Offline
        shabonaa
        wrote on last edited by
        #3

        will it overcome the delay problem in Ajax updatepanel ??

        C 1 Reply Last reply
        0
        • S shabonaa

          will it overcome the delay problem in Ajax updatepanel ??

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          AJAX means that your page updates without postbacks.

          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

          1 Reply Last reply
          0
          • S shabonaa

            i have cobmobox (chapters_combo) with visible= true and another two combos with visible = false i want when selecting chapter1 from chapters_combo then make the first combo visible = true and selecting chapter2 from chapters_combo then make the second combo visible = true chapters_combo has autopostback = true the problem each time selecting an item from chapters_combo the whole page update. is there any way do overcome that. i tried to use Ajax updatepanel but it takes about 15 sec to show the combo.

            J Offline
            J Offline
            Jeremy Likness
            wrote on last edited by
            #5

            Are you looking to load the data dynamically, or is it small enough that you can emit it to the browser? UpdatePanels are fine if you know how to use them correctly. Slamming one over the entire page isn't always good. You should have it surround the dependent ComboBox and then trigger it based on the source combo box, so only the view state and code for the combo is round tripped. There are two other methods that will work. The first is to emit the list to the client and parse it - take a look at my blog post: http://csharperimage.jeremylikness.com/2009/03/json-and-c-using-generics-and-delegates.html[^] Basically, I serialize my objects using JSON and reconstruct them on the client, then when one combo box changes, I parse the appropriate sublist and dynamically the options for the second control. This is fast because there is no round trip to the server. Finally, use a tool like Fiddler to examine your post going back and forth. 15 seconds is a long time so somewhere you have latency - whether its processing, network, database access, etc depends on many factors. If you wrapped the whole page in the update panel with viewstate turned on you could have a huge messae and you just need to wrap a smaller portion, which the AJAX extender will address. You might event want to look at implementing ICallbackEventhandler and wiring up the call yourself to trim down the size of the payload. Essentially you bind to the onchange for the dropdown, then use WebForm_DoCallback to call back, parse out the new values, etc.

            Jeremy Likness http://csharperimage.jeremylikness.com/

            S 1 Reply Last reply
            0
            • J Jeremy Likness

              Are you looking to load the data dynamically, or is it small enough that you can emit it to the browser? UpdatePanels are fine if you know how to use them correctly. Slamming one over the entire page isn't always good. You should have it surround the dependent ComboBox and then trigger it based on the source combo box, so only the view state and code for the combo is round tripped. There are two other methods that will work. The first is to emit the list to the client and parse it - take a look at my blog post: http://csharperimage.jeremylikness.com/2009/03/json-and-c-using-generics-and-delegates.html[^] Basically, I serialize my objects using JSON and reconstruct them on the client, then when one combo box changes, I parse the appropriate sublist and dynamically the options for the second control. This is fast because there is no round trip to the server. Finally, use a tool like Fiddler to examine your post going back and forth. 15 seconds is a long time so somewhere you have latency - whether its processing, network, database access, etc depends on many factors. If you wrapped the whole page in the update panel with viewstate turned on you could have a huge messae and you just need to wrap a smaller portion, which the AJAX extender will address. You might event want to look at implementing ICallbackEventhandler and wiring up the call yourself to trim down the size of the payload. Essentially you bind to the onchange for the dropdown, then use WebForm_DoCallback to call back, parse out the new values, etc.

              Jeremy Likness http://csharperimage.jeremylikness.com/

              S Offline
              S Offline
              shabonaa
              wrote on last edited by
              #6

              I'll check the link. the updatepanel is only containing the three comboboxes and all of the have static access "no db access". all it suppose to do is show and hide the combos

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups