[英]bootstrap accordion are not working inside repeater when using Master Pages
I am facing an issue with the bootstrap accordion control. 我正面临着bootstrap手风琴控制的问题。 I have kept a bootstrap accordion control inside a repeater. 我在转发器内部保留了一个自举手风琴控制器。 Inside the bootstrap accordion, there are bootstrap Tab panels. 在引导手风琴内部,有引导Tab面板。 When I tested it in a simple web-form, it was working perfectly, but when I used it in a content page which is nested within a master page, it is not working. 当我在一个简单的网络表单中测试它时,它工作得很好,但是当我在嵌套在母版页中的内容页面中使用它时,它无法正常工作。
The issue is that, I am assigning href property of an anchor tag as "#controlid" which is an id of div in the same page. 问题是,我将锚标记的href属性指定为“#controlid”,它是同一页面中div的id。 But when the page is rendered, "../" is added to the prefix of the href value. 但是,当呈现页面时,“../”被添加到href值的前缀。 So, when I check the html page source, it's like "../#controlid". 所以,当我检查html页面源代码时,它就像“../#controlid”。
So, when I click on accordion anchor tag, it redirects to home page, instead of expanding. 所以,当我点击手风琴锚标签时,它会重定向到主页,而不是扩展。
You can use Container.ItemIndex. 您可以使用Container.ItemIndex。
href="#collapse<%# Container.ItemIndex %>"
and 和
<div id="collapse<%# Container.ItemIndex %>" class="panel-collapse collapse in">
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.