ASP.NET MVC ListBox - AutoPostBack

  • Alfreds FutterkisteALFKI
  • Antonio Moreno TaqueríaANATR
  • Around the HornAROUT
  • Berglunds snabbköpANTON
  • Berglunds snabbköpBERGS
  • Blauer See DelikatessenBLAUS
  • Blondesddsl père et filsBLONP
  • Bólido Comidas preparadasBOLID
  • Bon app'BONAP
  • Bottom-Dollar MarketsBOTTM
  • B's BeveragesBSBEV
  • Cactus Comidas para llevarCACTU
  • Centro comercial MoctezumaCENTC
  • Chop-suey ChineseCHOPS
  • Comércio MineiroCOMMI
  • Consolidated HoldingsCONSH
  • Die Wandernde KuhWANDK
  • Drachenblut DelikatessenDRACD
  • Du monde entierDUMON
  • Eastern ConnectionEASTC
  • Ernst HandelERNSH
  • Familia ArquibaldoFAMIA
  • FISSA Fabrica Inter. Salchichas S.A.FISSA
  • Folies gourmandesFOLIG
  • Folk och fä HBFOLKO
  • France restaurationFRANR
  • Franchi S.p.A.FRANS
  • FrankenversandFRANK
  • Furia Bacalhau e Frutos do MarFURIB
  • Galería del gastrónomoGALED
  • Godos Cocina TípicaGODOS
  • Gourmet LanchonetesGOURL
  • Great Lakes Food MarketGREAL
  • GROSELLA-RestauranteGROSR
  • Hanari CarnesHANAR
  • HILARION-AbastosHILAA
  • Hungry Coyote Import StoreHUNGC
  • Hungry Owl All-Night GrocersHUNGO
  • Island TradingISLAT
  • Königlich EssenKOENE
  • La corne d'abondanceLACOR
  • La maison d'AsieLAMAI
  • Laughing Bacchus Wine CellarsLAUGB
  • Lazy K Kountry StoreLAZYK
  • Lehmanns MarktstandLEHMS
  • Let's Stop N ShopLETSS
  • LILA-SupermercadoLILAS
  • LINO-DelicatesesLINOD
  • Lonesome Pine RestaurantLONEP
  • Magazzini Alimentari RiunitiMAGAA
  • Maison DeweyMAISD
  • Mère PaillardeMEREP
  • Morgenstern GesundkostMORGK
  • North/SouthNORTS
  • Océano Atlántico Ltda.OCEAN
  • Old World DelicatessenOLDWO
  • Ottilies KäseladenOTTIK
  • Paris spécialitésPARIS
  • Pericles Comidas clásicasPERIC
  • Piccolo und mehrPICCO
  • Princesa Isabel VinhosPRINI
  • Que DelíciaQUEDE
  • Queen CozinhaQUEEN
  • QUICK-StopQUICK
  • Rancho grandeRANCH
  • Rattlesnake Canyon GroceryRATTC
  • Reggiani CaseificiREGGC
  • Ricardo AdocicadosRICAR
  • Richter SupermarktRICSU
  • Romero y tomilloROMEY
  • Santé GourmetSANTG
  • Save-a-lot MarketsSAVEA
  • Seven Seas ImportsSEVES
  • Simons bistroSIMOB
  • Spécialités du mondeSPECD
  • Split Rail Beer & AleSPLIR
  • Suprêmes délicesSUPRD
  • The Big CheeseTHEBI
  • The Cracker BoxTHECR
  • Toms SpezialitätenTOMSP
  • Tortuga RestauranteTORTU
  • Tradição HipermercadosTRADH
  • Trail's Head Gourmet ProvisionersTRAIH
  • VaffeljernetVAFFE
  • Victuailles en stockVICTE
  • Vins et alcools ChevalierVINET
  • Wartian HerkkuWARTH
  • Wellington ImportadoraWELLI
  • White Clover MarketsWHITC
  • Wilman KalaWILMK
  • Wolski ZajazdWOLZA
You can automate the process of posting the page back to the server after an item is selected from the list, by using the AutoPostBack property. When it is set to true the end users don't need to click any button on the page to post the page to the server - the ListBox will do it automatically.

Usually the AutoPostBack property is used alongside the SelectedIndexChanged server-side event, which allows you to handle the change event on the server. This event is used in this example too.
View - Aspx

    <% Html.Obout(new ListBox("ListBox1")
    {   
        AutoPostBack = true
    }); %> 
    
    
View - Razor

    @Html.Obout(new ListBox("ListBox1")
    {   
        AutoPostBack = true
    })