简体   繁体   English

Jquery崩溃并扩展服务器端控件

[英]Jquery collapse and expand server side control

i am using asp.net 3.5 and c#. 我正在使用asp.net 3.5和c#。

I have a server-side div (runat="server") and , what I want is this that when I click on the link, div1 will collapse. 我有一个服务器端div(runat =“server”),我想要的是当我点击链接时,div1将崩溃。 I have to do this in JQuery. 我必须在JQuery中这样做。

I already achieve the target to use the following example. 我已经实现了使用以下示例的目标。 It collapse and expand the client side div.. now i want to do the same thing to the server-side div control 它崩溃并扩展了客户端div ..现在我想对服务器端div控件做同样的事情

http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm

What the problem? 有什么问题? The only difference is that you need to use control's ClientID value. 唯一的区别是您需要使用control的ClientID值。 In your case if div with jason id has runat="server" attribute you may use: animatedcollapse.addDiv('<%= jason.ClientID %>', 'fade=1,height=80px') 在你的情况下,如果带有jason id的div具有runat =“server”属性,你可以使用: animatedcollapse.addDiv('<%= jason.ClientID %>', 'fade=1,height=80px')

By 'do the same on the serverside', do you mean you want state to persist when you click on other elements that cause postback? 通过'在服务器端执行相同',您是否意味着当您单击导致回发的其他元素时,您希望状态持续存在?

I did a blog post on doing this with a Panel control and remembering its state on the server side so if you click on other elements the state persists through postbacks. 我做了一篇关于使用Panel控件执行此操作并在服务器端记住其状态的博客文章,因此如果您单击其他元素,状态将通过回发持续存在。 It should equally apply to a DIV: Persisting Collapse state on postback 它同样适用于DIV: 在回发时保持崩溃状态

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM