我在我的动态数据应用程序中有一个数据处理程序,我想在这里使用Ajax日历扩展程序。我知道错误:-
只能将一个ScriptManager实例添加到页面中。
我知道母版页已经有了脚本管理器。我试过使用"Asp:ScriptManagerProxy“,但没有起作用。
下面是我的DateFilter.ascx。如有任何帮助,我们将不胜感激:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DateFilter.ascx.cs" Inherits="TestApp.DynamicData.Filters.DateFilter" %>
<%--<Asp:ScriptManagerProxy runat="server" ID="proxy"/>--%>
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</ajaxToolkit:ToolkitScriptManager>
<asp:TextBox ID="txtStartDate" runat="server"></asp:TextBox>
<asp:TextBox ID="txtEndDate" runat="server"></asp:TextBox>
<ajaxToolkit:CalendarExtender
ID="CalendarExtender1"
TargetControlID="txtStartDate"
runat="server" />
<ajaxToolkit:CalendarExtender
ID="CalendarExtender2"
TargetControlID="txtEndDate"
runat="server" /> 下面是我的动态数据应用程序的site.master
<%@ Master Language="C#" CodeBehind="Site.master.cs" Inherits="TestApp.Site" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Dynamic Data Site</title>
<link href="~/Site.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<h1 class="DDMainHeader">Test App</h1>
<div class="DDNavigation">
<%-- <a runat="server" href="~/"><img alt="Back to home page" runat="server" src="DynamicData/Content/Images/back.gif" />Back to home page</a>--%>
</div>
<form id="form1" runat="server">
<div>
<%-- TODO: Enable partial rendering by setting the EnablePartialRendering attribute to "true" to provide a smoother browsing experience.
Leaving partial rendering disabled will provide a better debugging experience while the application is in development. --%>
<asp:ScriptManager runat="server" EnablePartialRendering="true">
<Scripts>
<asp:ScriptReference Name="jquery" />
<asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" />
</Scripts>
</asp:ScriptManager>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>发布于 2013-12-19 17:16:57
我认为如果您在母版页中使用ToolkitScriptManager,则不需要在您的ascx中放置任何内容。
https://stackoverflow.com/questions/20687446
复制相似问题