To achieve your goal, I have built a test application based on your situation, please refer to the code and the comment in it:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="TestModalAnimationFadeIn.aspx.vb"
Inherits="SoluTest_AnimationInUserControl.TestModalAnimationFadeIn" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
function pageLoad() {
$addHandler($get("showModalPopupClientButton"), 'click', showModalPopupViaClient);
$addHandler($get("hideModalPopupViaClientButton"), 'click', hideModalPopupViaClient);
}
function showModalPopupViaClient(ev) {
ev.preventDefault();
var modalPopupBehavior = $find('programmaticModalPopupBehavior');
$find("AEFadeIn").get_OnClickBehavior().play();
modalPopupBehavior.show();
}
function hideModalPopupViaClient(ev) {
ev.preventDefault();
var modalPopupBehavior = $find('programmaticModalPopupBehavior');
modalPopupBehavior.hide();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<ajaxToolkit:AnimationExtender ID="AEFadeIn" runat="server" Enabled="True" TargetControlID="hfFadeIn">
<Animations>
<OnClick>
<%-- We need set the AnimationTarget with the control which needs to make animation --%>
<Sequence AnimationTarget="Popup">
<%--The FadeIn and Display animation.--%>
<FadeIn Duration="1" MinimumOpacity="0" MaximumOpacity="1" />
</Sequence>
</OnClick>
</Animations>
</ajaxToolkit:AnimationExtender>
<%-- Dummy TargetControl HiddenField--%>
<asp:HiddenField runat="server" ID="hfFadeIn" />
<%-- ************** --%>
<a id="showModalPopupClientButton" class="nav" href="http://forums.asp.net/AddPost.aspx?ForumID=1022#">
<strong>Click Here</strong></a><br />
<asp:Button runat="server" ID="hiddenTargetControlForModalPopup" Style="display: none" />
<ajaxToolkit:ModalPopupExtender runat="server" ID="programmaticModalPopup" BehaviorID="programmaticModalPopupBehavior"
TargetControlID="hiddenTargetControlForModalPopup" PopupControlID="Popup" BackgroundCssClass="modalBackground">
</ajaxToolkit:ModalPopupExtender>
<asp:Panel runat="server" ID="Popup" Style="display: none; width: 600px; height: 400px;
background-color: White; border-width: 2px; border-color: #009933; border-style: solid;
padding: 10px;">
<img src="images/block.gif" alt="" />
<div class="right">
-<a id="hideModalPopupViaClientButton" class="nav" href="http://forums.asp.net/AddPost.aspx?ForumID=1022#">
close </a>-
</div>
</asp:Panel>
</div>
</form>
</body>
</html>
Have my code helped?
Best regards,
Zhi-Qiang Ni
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as
Answer” if a marked post does not actually answer your question.
Zhi-Qiang Ni...
All-Star
33491 Points
2952 Posts
Microsoft
Re: AnimationExtender with ModalPopup
Sep 16, 2008 10:21 AM|LINK
To achieve your goal, I have built a test application based on your situation, please refer to the code and the comment in it: Have my code helped?
Best regards,
Zhi-Qiang Ni
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as
Answer” if a marked post does not actually answer your question.