jQuery手风琴+ ASP:MultiView [英] jQuery Accordion + ASP:MultiView
问题描述
我的问题与此处提出的问题类似,但是那里的解决方案不足以让我理解/请求更多的详细说明和/或代码示例:
My issue is similar to the one asked here, but the solution out there was not simple enough for me to comprehend / requesting more elaboration and/or code samples:
我有一个在base.aspx上初始化的jQuery UI手风琴
I have a jQuery UI accordion initialized on base.aspx
<script type="text/javascript">
$(document).ready(function () {
var icons = {
header: "ui-icon-circle-arrow-e",
headerSelected: "ui-icon-circle-arrow-s"
};
$("#accordion1").accordion({
autoHeight: false,
icons: icons,
event: "mouseover"
});
});
</script>
然后在我的手风琴DIV中,我调用了多个用户控件,每个手风琴节都对应一个控件:
Then in my accordion DIV, I call several user controls, one for each accordion section:
<div id="accordion1">
<DT:TrainerCost ID="dtTrainerCost" runat="server" Visible="false" />
<DT:TrainerAvailability ID="dtTrainerAvailability" runat="server" Visible="false" />
<DT:ProfessionalInfo ID="dtProfessionalInfo" runat="server" />
</div>
这些控件中具有一个带有两个索引0和1的ASP:MultiView.它们默认为0.Index0中有一个按钮,如果单击该按钮,将启动View1.
These controls have in them an ASP:MultiView with two indexes 0 and 1. They default to 0. There's a button in Index0 which if clicked, launches View1.
当我显示默认的Index0(页面加载时)时,手风琴的所有功能都运行良好.但是在单击触发View1的按钮时,我失去了jQuery手风琴功能...根据另一篇文章,当多视图切换时,似乎jQuery绑定被破坏了?
When I display the default Index0 (on page load) everything with the accordion works well. But on clicking the button that triggers View1, I lose the jQuery accordion functionality... as per the other post, seems like jQuery bindings are being broken when the multi-view switches?
推荐答案
几天后,我得以解决问题.这两篇文章把它丢掉了:
Few days later, I was able to resolve my issue. These two articles gave it away:
http://siderite.blogspot.com/2009/01/include-external-javascript-on-async.html
底线是ASP.Net AJAX的浏览器问题.
Bottomline was browser issues with ASP.Net AJAX.
这篇关于jQuery手风琴+ ASP:MultiView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!