M
mike
I'm having a problem getting AJAX working with a master page.
I have created a new website using the AJAXControlToolkit template and
default.aspx as follows.
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/
TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<aspanel ID="Panel1" runat="server" Height="134px"
Width="217px">
This is where the definition goes! It should be invisible
until the LinkButton is hovered on.
</aspanel>
<br />
<asp:LinkButton ID="LinkButton1"
runat="server">LinkButton</asp:LinkButton><br />
<ajaxToolkit:AnimationExtender ID="AnimationExtender1"
runat="server" TargetControlID="LinkButton1">
<Animations>
<OnHoverOver>
<FadeIn AnimationTarget="Panel1" Duration=".
5" />
</OnHoverOver>
<OnHoverOut>
<FadeOut AnimationTarget="Panel1" Duration=".
5" />
</OnHoverOut>
</Animations>
</ajaxToolkit:AnimationExtender>
</form>
</body>
</html>
This page works correctly, fading in when hovering over the LinkButton
and fading out when moving off.
Then I created a master page (I added nothing to it) and a new WebForm
based on this master page.
Here's the WebForm.
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="ATKTest.aspx.cs" Inherits="ATKTest"
Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<aspanel ID="Panel1" runat="server" Height="134px"
Width="217px">
This is where the definition goes! It should be
invisible until the LinkButton is hovered on.
</aspanel>
<br />
<asp:LinkButton ID="LinkButton1" runat="server">AM -
Amplitude</asp:LinkButton><br />
<ajaxToolkit:AnimationExtender ID="AnimationExtender1"
runat="server" TargetControlID="LinkButton1">
<Animations>
<OnHoverOver>
<FadeIn AnimationTarget="Panel1" Duration=".
5" />
</OnHoverOver>
<OnHoverOut>
<FadeOut AnimationTarget="Panel1" Duration=".
5" />
</OnHoverOut>
</Animations>
</ajaxToolkit:AnimationExtender>
</div>
</asp:Content>
this page does not work and generates a Javascript error as follows:
----------
Sys.ArgumentException:
AjaxControlToolKit.Animation.Animation.set_animationTarget requires
the ID
of a Sys.UI.DomElement or a Sys.UI.Control. No element or control
could be
found corresponding to 'Panel1'
Parameter name: id
I have created a new website using the AJAXControlToolkit template and
default.aspx as follows.
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/
TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<aspanel ID="Panel1" runat="server" Height="134px"
Width="217px">
This is where the definition goes! It should be invisible
until the LinkButton is hovered on.
</aspanel>
<br />
<asp:LinkButton ID="LinkButton1"
runat="server">LinkButton</asp:LinkButton><br />
<ajaxToolkit:AnimationExtender ID="AnimationExtender1"
runat="server" TargetControlID="LinkButton1">
<Animations>
<OnHoverOver>
<FadeIn AnimationTarget="Panel1" Duration=".
5" />
</OnHoverOver>
<OnHoverOut>
<FadeOut AnimationTarget="Panel1" Duration=".
5" />
</OnHoverOut>
</Animations>
</ajaxToolkit:AnimationExtender>
</form>
</body>
</html>
This page works correctly, fading in when hovering over the LinkButton
and fading out when moving off.
Then I created a master page (I added nothing to it) and a new WebForm
based on this master page.
Here's the WebForm.
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="ATKTest.aspx.cs" Inherits="ATKTest"
Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<aspanel ID="Panel1" runat="server" Height="134px"
Width="217px">
This is where the definition goes! It should be
invisible until the LinkButton is hovered on.
</aspanel>
<br />
<asp:LinkButton ID="LinkButton1" runat="server">AM -
Amplitude</asp:LinkButton><br />
<ajaxToolkit:AnimationExtender ID="AnimationExtender1"
runat="server" TargetControlID="LinkButton1">
<Animations>
<OnHoverOver>
<FadeIn AnimationTarget="Panel1" Duration=".
5" />
</OnHoverOver>
<OnHoverOut>
<FadeOut AnimationTarget="Panel1" Duration=".
5" />
</OnHoverOut>
</Animations>
</ajaxToolkit:AnimationExtender>
</div>
</asp:Content>
this page does not work and generates a Javascript error as follows:
----------
Sys.ArgumentException:
AjaxControlToolKit.Animation.Animation.set_animationTarget requires
the ID
of a Sys.UI.DomElement or a Sys.UI.Control. No element or control
could be
found corresponding to 'Panel1'
Parameter name: id