asp.net - Ascx control visible false issue -
i have tab control in 1 aspx page has 5 tabs. loading 5 ascx pages on control. have 4 ascx child controls inside 2nd main ascx control. wizard on 2nd main ascx page. when load 2nd tab make visible 1st child ascx control. based on selection of values on control making visible true 2nd ascx child control , visible false 1st ascx child control. thats not working. not able see in page. loading empty out controls.
what issue?
parent ascx - custom event child ascx
private sub page_init(byval sender object, byval e system.eventargs) handles me.init reviewenterreportdetailsid.visible = true enterreportdetailid.visible = true enterreportviewdetail1.visible = true end sub protected sub page_load(byval sender object, byval e system.eventargs) handles me.load reviewenterreportdetailsid.visible = true enterreportdetailid.visible = false enterreportviewdetail1.visible = false end sub protected sub reviewenterreportdetailsid_erdscreenevent(byval sender object, byval e system.eventargs) handles reviewenterreportdetailsid.erdscreenevent reviewenterreportdetailsid.visible = false enterreportdetailid.visible = true enterreportviewdetail1.visible = false end sub
child ascx -
just raising event change next control
without seeing actual code it's little hard say, however, when use visible=false
nothing control rendered .net, hence seeing nothing in source code view.
ideally should put these controls <div>
, show/hide <div>
based on conditions.
update
also, looking @ (recently added) code, start off in init
showing 3 , in load
hide last 2. seems little pointless load
fired right after init
also - if not wrap load
, init
code in if (not ispostback)
fired everytime page reloads. wrap code in if (not ispostback)
, prevent load
overriding set in reviewenterreportdetailsid_erdscreenevent
Comments
Post a Comment