.net - dropdown selected value is getting lost when inside a hidden asp:panel -
i have web form consisting of few asp:panels. 1 panel visible @ time. user fills forms next panel becomes visible.
in second panel there dropdown list.
i setting selectedvalue of dropdownlist on page load, if not page postback. when second panel becomes visible, dropdownlist not preselected.
everything else prepopulated except dropdown list. there other dropdown lists on other hidden panels, prepopulated appropriately.
furthermore, if move dropdownlist outside panel, works intended, meaning, selectedvalue prepopulated.
if remove line panels set visible = false, dropdownlist gets populated fine.
as add code hide panels , show them 1 one, selected value not there.
here code
protected sub page_load(sender object, e system.eventargs) handles me.load if not page.ispostback ... dropdownlist1.selectedvalue = .item("city") hideallpanels() ... end sub protected sub linkbutton2_click(byval sender object, byval e system.eventargs) handles linkbutton2.click hideallpanels() panel2.visible = true end sub
Comments
Post a Comment