所以我有一個名爲WebParts.aspx文件,它看起來像這樣 -元素「ToolkitScriptManager」不是一個已知的元素
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebParts.aspx.cs" Inherits="e.WebParts" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<!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>
</head>
<body>
<form id="form1" runat="server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<div>
<asp:TabContainer ID="TabContainer1" runat="server">
<asp:TabPanel ID="TabPanel1" runat="server">
<ContentTemplate>Page One</ContentTemplate>
</asp:TabPanel>
<asp:TabPanel ID="TabPanel2" runat="server">
<ContentTemplate>Page Two</ContentTemplate>
</asp:TabPanel>
<asp:TabPanel ID="TabPanel3" runat="server">
<ContentTemplate>Page Three</ContentTemplate>
</asp:TabPanel>
</asp:TabContainer>
</div>
</form>
</body>
</html>
和產生創造一個選項卡容器內的3個面板所期望的結果。
然而,當我更改頁面使用MasterPage.master看起來像這樣 -
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebParts.aspx.cs" Inherits="eservice.WebParts" MasterPageFile="~/MasterPage.Master"%>
<asp:Content ID="Content2"
ContentPlaceHolderID="ContentPlaceHolder1"
runat="server">
<asp:LoginView ID="LoginView1" runat="server">
<LoggedInTemplate>
<p id="backtoblog"></p>
<p> Preferences</p>
<div>
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<div>
<asp:TabContainer ID="TabContainer1" runat="server">
<asp:TabPanel ID="TabPanel1" runat="server">
<ContentTemplate>Page One</ContentTemplate>
</asp:TabPanel>
<asp:TabPanel ID="TabPanel2" runat="server">
<ContentTemplate>Page Two</ContentTemplate>
</asp:TabPanel>
<asp:TabPanel ID="TabPanel3" runat="server">
<ContentTemplate>Page Three</ContentTemplate>
</asp:TabPanel>
</asp:TabContainer>
</div>
</div>
</LoggedInTemplate>
<AnonymousTemplate>
You are not logged in.
<br />
Please login to access eservice
</AnonymousTemplate>
</asp:LoginView>
</asp:Content>
VS2008給了我以下警告:
元素 'ToolkitScriptManager' 不是一個 已知元素。如果 網站中存在編譯錯誤,或者缺少web.config文件 ,則會發生這種情況。
以下行:
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
非常感謝Domenic! – Das 2010-07-10 20:52:34