Monday, March 26, 2012

Tab control wont see script manager on page

I have a master page setup. I have no Ajax controls in the masterpage at all, I am doing this purely in the content page. I am using Ajax 1.0 and the toolkit. I did install the CTP just in case it was looking for something there but it didn't help.

I am using a existing project that had no ajax setup originally. I edited the webconfig file and added all the relavent sections except the bit about IIS 7 which I am not using and the webservices which I am also not using.

I add a script manager and an update panel. The update panel is working perfectly. I then add a tab container and a tab panel from the toolkit and the tab panel gives me an error saying a script manager is required on the page. I tried moving the scriptmanager to the masterpage itself based on a few posts I saw here but it didn't make any difference.

Here is the source code. I removed most of the excess code so you could see the control placement without too much confusion.

<%

@dotnet.itags.org.PageLanguage="VB"MasterPageFile="~/Master1.master"AutoEventWireup="false"CodeFile="InvComputerRpt.aspx.vb"Inherits="Inventory_InvComputerRpt"title="IT Report" %>
<%@dotnet.itags.org.RegisterAssembly="AjaxControlToolkit"Namespace="AjaxControlToolkit"TagPrefix="cc1" %>
<%@dotnet.itags.org.RegisterAssembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"Namespace="System.Web.UI"TagPrefix="asp" %>

<asp:ContentID="Content1"ContentPlaceHolderID="ContentPlaceHolder1"Runat="Server">
<asp:ScriptManagerid="ScriptManager1"runat="server"></asp:ScriptManager>

<cc1:TabContainerID="TabContainer1"runat="server"></cc1:TabContainer>
<cc1:TabPanelID="TabPanel1"runat="server"></cc1:TabPanel><asp:MultiViewID="MultiView1"runat="server"ActiveViewIndex="0">
<asp:ViewID="View1"runat="server"><asp:UpdatePanelid="UpdatePanel1"runat="server">
<contenttemplate>
<asp:CheckBoxListid="CheckBoxList1"runat="server"></asp:CheckBoxList>
<asp:DropDownListid="ddlDept"</asp:DropDownList>
<asp:DropDownListid="ddlCat"runat="server"</asp:DropDownList>
<asp:GridViewid="GridView1"runat="server"></asp:GridView>
</contenttemplate>
</asp:UpdatePanel>

</asp:View>
</asp:MultiView>
</asp:Content>

Here's a version of your sample that runs fine in the SampleWebSite that comes with the Toolkit (note that TabPanel belongs inside TabContainer):

<%@. Page Language="C#" MasterPageFile="~/DefaultMaster.master" Title="Untitled Page" %><%@. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %><asp:Content ID="Content1" ContentPlaceHolderID="SampleContent" runat="Server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <cc1:TabContainer ID="TabContainer1" runat="server"> <cc1:TabPanel ID="TabPanel1" runat="server"> </cc1:TabPanel> </cc1:TabContainer> <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0"> <asp:View ID="View1" runat="server"> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:CheckBoxList ID="CheckBoxList1" runat="server"> </asp:CheckBoxList> <asp:DropDownList ID="ddlDept" runat="server"> </asp:DropDownList> <asp:DropDownList ID="ddlCat" runat="server"> </asp:DropDownList> <asp:GridView ID="GridView1" runat="server"> </asp:GridView> </ContentTemplate> </asp:UpdatePanel> </asp:View> </asp:MultiView></asp:Content>

Hi David,

Thankyou, moving it between the container tags helped. I should have mentioned I was using Web Developer Express. I don't know if the behaviour is different in VS2005 but part of the problem was the designer not showing anything either so I didn't think it was working. Now I twigged that I am editing the source code to set my page up.

Regards

Victoria

No comments:

Post a Comment