AJAX in master page


G

Guest

Hi I have an Accordion control that works in an aspx page but stops working
when used in a master page. I have used other controls from the toolkit with
master pages so I am not sure what I'm doing wrong. Any help would be much
appreciated.

this page works:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default6.aspx.cs"
Inherits="Default6" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit"
TagPrefix="cc1" %>

<!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>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="Scriptmanager1" runat="server"
EnablePartialRendering="true"></asp:ScriptManager>
<script language="javascript" type="text/javascript">
function Openpane(paneIndex,eventElement) {
var behavior = $get("Accordion1").AccordionBehavior;
behavior.set_SelectedIndex(paneIndex);
}
</script>
<cc1:Accordion ID="Accordion1" runat="server" ContentCssClass="dimgreen"
FadeTransitions="false" FramesPerSecond="25"
TransitionDuration="250" HeaderCssClass="grey"
EnableViewState="false" SelectedIndex="-1"
SuppressHeaderPostbacks="true">
<Panes>
<cc1:AccordionPane runat="server" ID="PaneOne">
<Header>
<span
onmouseover="Openpane('0',event)">Accordion</span>
</Header>
<Content>
<br />
<br />
Expand Accordion Panes on Mouse Over :: Pane 1
<br />
<br />
</Content>
</cc1:AccordionPane>
<cc1:AccordionPane runat="server" ID="AccordionPane1">
<Header>
<span onmouseover="Openpane('1',event)">Open
Panes</span>
</Header>
<Content>
<br />
<br />
Expand Accordion Panes on Mouse Over :: Pane 2
<br />
<br />
</Content>
</cc1:AccordionPane>
<cc1:AccordionPane runat="server" ID="AccordionPane2">
<Header>
<span onmouseover="Openpane('2',event)">On
MouseOver</span>
</Header>
<Content>
<br />
<br />
Expand Accordion Panes on Mouse Over :: Pane 3
<br />
<br />
</Content>
</cc1:AccordionPane>
</Panes>
</cc1:Accordion>
</form>
</body>
</html>

IN THE SAME APP this page does not work:

<%@ Master Language="C#" AutoEventWireup="true"
CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit"
TagPrefix="cc1" %>
<!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>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="Scriptmanager1" runat="server"
EnablePartialRendering="true"></asp:ScriptManager>
<script language="javascript" type="text/javascript">
function Openpane(paneIndex,eventElement) {
var behavior = $get("Accordion1").AccordionBehavior;
behavior.set_SelectedIndex(paneIndex);
}
</script>
<div>
<cc1:Accordion ID="Accordion1" runat="server" ContentCssClass="dimgreen"
FadeTransitions="false" FramesPerSecond="25"
TransitionDuration="250" HeaderCssClass="grey"
EnableViewState="false" SelectedIndex="-1"
SuppressHeaderPostbacks="true">
<Panes>
<cc1:AccordionPane runat="server" ID="PaneOne">
<Header>
<span
onmouseover="Openpane('0',event)">Accordion</span>
</Header>
<Content>
<br />
<br />
Expand Accordion Panes on Mouse Over :: Pane 1
<br />
<br />
</Content>
</cc1:AccordionPane>
<cc1:AccordionPane runat="server" ID="AccordionPane1">
<Header>
<span onmouseover="Openpane('1',event)">Open
Panes</span>
</Header>
<Content>
<br />
<br />
Expand Accordion Panes on Mouse Over :: Pane 2
<br />
<br />
</Content>
</cc1:AccordionPane>
<cc1:AccordionPane runat="server" ID="AccordionPane2">
<Header>
<span onmouseover="Openpane('2',event)">On
MouseOver</span>
</Header>
<Content>
<br />
<br />
Expand Accordion Panes on Mouse Over :: Pane 3
<br />
<br />
</Content>
</cc1:AccordionPane>
</Panes>
</cc1:Accordion>

<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</div>
</form>
</body>
</html>
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top