Asp.Net动画 [英] Asp.Net Animation

查看:67
本文介绍了Asp.Net动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,
请帮我解决我的问题.

问题:-
我想在按钮单击事件上显示面板.
当按下按钮时,面板会淡入并显示.
我尝试使用Ajax,但是回发时面板不可见.


请帮帮我,
提前谢谢,
Chirag

Hi friends,
Please help me about my problem..

Problem:-
I want to show panel on button click event.
when button is pressed the panel is fade in and displayed.
i tried using Ajax but when post back occur panel is invisible.


Please Help Me,
Thanks In advance,
Chirag

推荐答案

好,那是因为您使用Java脚本在UI中进行了更改.状态未保持.

为了持久保留它,您需要在隐藏字段中保留有关可见性的标志,或者在使其可见后使用XMLHttpRequest保存Panel的状态.

为简单起见,请使用隐藏字段".在显示面板时,将值设置为true.重新渲染回发/页面时,请检查此隐藏字段的值,并根据该值设置面板的可见性.
Well, that is because you made the change in UI using Javascript. State was not maintained.

In order to persist it, you need to either keep a flag regarding visibility in a hidden field OR use XMLHttpRequest to save the state of the Panel after making it visible.

For simplicity, use Hidden Fields. At the time of showing the panel, set the value to true. While postback/page re-render, check the value of this hidden field and based on the value set the visibility of the panel.


您应该为此使用javascript.这是一个示例:

http://www.switchonthecode.com/tutorials/javascript-tutorial-simple-fade-animation [^ ]
You should use javascript for this. Here''s an example:

http://www.switchonthecode.com/tutorials/javascript-tutorial-simple-fade-animation[^]


很显然,您需要编写所有客户端代码才能做到这一点.为什么AJAX调用会有所不同,它也不会引起任何回发.

也许如果您发布了代码,我们就能知道问题出在哪里吗?
Well, you need to write all client side code to do that, obviously. Why would an AJAX call make any difference, it''s also going to not cause any postback.

Perhaps if you posted code, we could tell what the issue is ?


这篇关于Asp.Net动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆