この Stack Overflow postRowClickableGridView
で提供されているクラスを使用して、カスタム コントロールを実装しようとしています。カスタム サーバー コントロールの作成を試みたのはこれが初めてで、この MSDN ウォークスルーに示されている手順に従いました。
名前空間が の Web アプリケーション プロジェクトのディレクトリにクラスRowClickableGridView
があり、コンパイルされます。App\_Code
MyWebApplication.App\_Code
私の問題は.aspx
、コントロールを使用しようとしているページがタグ プレフィックスを認識しないことです。cc1:GridViewRowClickable
このページには、タグ間のサポートされていない要素に関する多数の警告もあります。MSDN ウォークスルーによると、すべてが整っていると思いました。
コードスニペット
<%@ Page Title="MyPage" Language="C#" MasterPageFile="~/MyMaster.master" AutoEventWireup="true" Inherits="MyPage" Codebehind="MyPage.aspx.cs" %>
<%@ Register TagPrefix="cc1" TagName="RowClickableGridView" Namespace="MyWebApplication.App_Code" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MyConnectionString %>" SelectCommand="MySpName" SelectCommandType="StoredProcedure">
</asp:SqlDataSource>
<cc1:RowClickableGridView ID="GVW_test" runat="server" DataSourceID="SqlDataSource1">
<HeaderStyle CssClass="ListTop" />
<RowStyle CssClass="RowHighlight" />
<Columns>
<asp:BoundField HeaderText="ID" DataField="Atr_ID" SortExpression="Atr_ID" />
<asp:BoundField HeaderText="Name" DataField="Atr_Name" SortExpression="Atr_Name" />
</Columns>
<EmptyDataTemplate>
No Data
</EmptyDataTemplate>
</cc1:RowClickableGridView>
</asp:Content>
私が間違っていることや、次に何を試すべきかについての提案はありますか?