asp.net - Dynamic Bootstrap Accordian loads in show -
asp.net - Dynamic Bootstrap Accordian loads in show -
i have bootstrap accordion generated dynamically code behind. loaded during page_init. works except set open ('show') not closed ('hide').
if take generated markup , run it, works fine html ok. ideas?
thanks
============== edit ============
this script resolves problem
private sub sectionclose() seek dim sb new stringbuilder sb.append("$(document).ready(function(){") sb.append(" $('#accordion').accordion({ collapsible: true, active: false }); ") sb.append("$('.selector').accordion(); ") sb.append("}); ") scriptmanager.registerstartupscript(me, me.gettype(), "showcollapse", sb.tostring, true) grab ex exception dim verror new senderror verror.mailerror("214", pagename, ex) end seek end sub
and works perfectly, throws object doesn't back upwards property or method 'accordion'
this generated markup looks like
<div class="panel panel-default"> <div class="panel-heading">current board members</div> <!-- start of dynamic elements --> <div id="maincontent_contactboardmembers" class="panel-body"> <div class="panel-group" id="accordion"> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="#collapse_1">john doe - treasurer</a></h4> </div> <div id="collapse_1" class="panel-collapse collapse"> <div class="panel-body"></div> </div> <div class="panel-heading"> <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="#collapse_2">john smith - president</a></h4> </div> <div id="collapse_2" class="panel-collapse collapse"> <div class="panel-body"></div> </div> <div class="panel-heading"> <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="#collapse_3">bill mathews - director @ large</a></h4> </div> <div id="collapse_3" class="panel-collapse collapse"> <div class="panel-body"></div> </div> </div> </div> </div> <!-- end of dynamic elements --> </div>
i noticed 'solution' (adding script) didn't help , when added jquery.ui page (for reason wasn't working in bundle) error went, issue still there - did notice every time there javascript error accordion worked, disabled 1 script @ time in masterpage.
the navbar built dynamically , script loaded alter @media according how big - 1 time changed .collapse .navbar-collapse worked :-)
asp.net twitter-bootstrap webforms
Comments
Post a Comment