开发者

Registering jQuery with ScriptManager

I am using the Dynamic Drive 'Animated Collapsible DIV v2.4' script - My page has 8 div's each of which I wish to be able to expand and collapse.

I register the jQuery from Page_Load as follows: (I also tried in Page_PreRender but same problem)

ScriptManager.RegisterClientScriptInclude(Me, Me.GetType, "AnimatedCollapse", Page.ResolveUrl("~/include/animatedcollapse.js"))
ScriptManager.RegisterClientScriptInclude(Me, Me.GetType, "BensJQuery", Page.ResolveUrl("~/include/BensJquery.js"))

The animatedcollapse.js file is what was downloaded from the Dynamic Drive website. BensJquery is a file with the main $(document).ready(function () { handler which initialises the animated collapse script.

Without using an UpdatePanel on my page, this is working perfectly.

However when I introduce an UpdatePanel to the page which contains all the 8 <div> elements, the page no longer functions as expected.

When I cause a postback (e.g. click a button), the functionality all breaks. All the <div>开发者_StackOverflow中文版 elements collapse and cannot be expanded again, the page just generally breaks, but there are no JavaScript errors displayed or .NET errors in the events viewer.

What do I need to do so that I can use an UpdatePanel successfully with this jQuery?

EDIT

I have solved this problem by not using one all-encompassing UpdatePanel but instead using them more sparingly and only when needed, which is probably quite a bit better now anyway.

Thanks,

bgs264


I have solved this problem by not using one all-encompassing UpdatePanel but instead using them more sparingly and only when needed, which is probably quite a bit better now anyway.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜