0

我试图在我的 ASP.NET 网站的 gridview 单元中实现一个“numericupdown”AJAX 控件。

我从工具箱的 AJAX 扩展部分拖放了一个“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">

欢迎来到“CD 收藏”。从这里您可以浏览和搜索所有您喜爱的音乐!

    <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>
4

1 回答 1

0

对于其他收到此错误消息的人。请确保从 ASP AJAX 站点下载 AJAX 工具包。然后将 ToolKitScriptManager 拖到您的页面上。

于 2013-03-23T13:51:11.883 回答