我试图在我的ASP.NET网站的gridview单元格中实现'numericupdown'AJAX控件。
我从工具箱的AJAX Extentions部分拖放了一个'scriptManager'。
目前,当我运行我的网站(本地托管)时,我收到以下错误:
Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Unknown server tag 'ScriptManager1:numericupdownextender'.
Source Error:
Line 85: </asp:GridView>
Line 86:
Line 87: <ScriptManager1:numericupdownextender
Line 88: id="NumericUpDownExtender1"
Line 89: runat="server"
我做了一些研究,似乎这是一个常见的问题,但在我坚持如何解决之前从未处理过AJAX。这是我网站的服务器端代码:
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="ViewCDs._Default" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<asp:Label ID="Label1" runat="server" Text="Select Search Type:"></asp:Label>
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>CD Title</asp:ListItem>
<asp:ListItem>Artist</asp:ListItem>
<asp:ListItem>Music Genre</asp:ListItem>
</asp:DropDownList>
<asp:Label ID="Label2" runat="server" Text="Search Term:"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Search" onclick="btnSearch_Click" />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:cdsCollectionsConnectionString3 %>"
SelectCommand="SELECT * FROM [cds]"></asp:SqlDataSource>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:GridView ID="GridView1" runat="server" Width="918px"
AutoGenerateColumns="False" DataKeyNames="_id" AllowPaging="True"
PageSize="1">
<RowStyle HorizontalAlign = "Center" />
<Columns>
<asp:BoundField DataField="_id" HeaderText="_id" InsertVisible="False"
ReadOnly="True" SortExpression="_id" Visible="false" />
<asp:TemplateField HeaderText = "Pic">
<ItemTemplate>
<asp:Image ID = "Image1" ImageUrl='<%# (string) FormatImageUrl( (string) Eval("pic")) %>' runat="server" />
</ItemTemplate>
<ItemStyle Width="185px" />
</asp:TemplateField>
<asp:BoundField DataField="cdTitle" HeaderText="CD Title"
SortExpression="cdTitle" />
<asp:BoundField DataField="artist" HeaderText="Artist"
SortExpression="artist" />
<asp:BoundField DataField="genre" HeaderText="Music Genre" SortExpression="genre" />
<asp:BoundField DataField="pic" HeaderText="pic" SortExpression="pic" Visible="false" />
<asp:TemplateField HeaderText = "Picc">
<ItemTemplate>
<asp:TextBox ID="txtQuan" Text = "1" Height="15" runat="server" />
<asp:ImageButton
ID="ImageButton2"
runat="server"
ImageUrl="Images/arrowup.jpg"
AlternateText="Up"
Width="15"
Height="15" />
<asp:ImageButton
ID="ImageButton1"
runat="server"
ImageUrl="Images/arrowdown.jpg"
AlternateText="Up"
Width="15"
Height="15" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<ScriptManager1:numericupdownextender
id="NumericUpDownExtender1"
runat="server"
targetcontrolid="TxtQuan"
width="120"
refvalues=""
servicedownmethod=""
serviceupmethod=""
targetbuttondownid=""
targetbuttonupid=""
minimum="1"
maximum="10" />
</p>
</asp:Content>
答案 0 :(得分:0)
我不认为你是如何使用它的......
请观看此视频:
答案 1 :(得分:0)
其他人收到此错误消息。请确保从ASP AJAX站点下载AJAX工具包。然后将ToolKitScriptManager拖到页面上。