Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 496433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:41:09+00:00 2026-05-13T05:41:09+00:00

I am trying to implement a custom control using a RowClickableGridView class provided on

  • 0

I am trying to implement a custom control using a RowClickableGridView class provided on this Stack Overflow post. This is the first time I have tried to create a custom server control and followed steps laid out in this MSDN walkthrough.

I have the RowClickableGridView class in the App\_Code directory of my Web Application Project with a namespace of MyWebApplication.App\_Code, and it compiles.

My problem is that the .aspx page that I am trying to use the control on does not recognize the tag prefix. The page also has numerous warnings for unsupported elements between the cc1:GridViewRowClickable tags. I thought I had everything in place according to the MSDN walkthrough.

Code Snippet

<%@ 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>

Any idea on what I am doing wrong or suggestions on what to try next?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T05:41:09+00:00Added an answer on May 13, 2026 at 5:41 am

    I got it to work finally. I took a different approach though.

    1. Create a new ASP.NET Server Control Project
    2. Copy class into default cs file and renamed namespace.
    3. Add default TagPrefix to line above namespace declaration.
      [assembly: TagPrefix("mynamespace", "mycustomtag")]
    4. Add ToolBoxData to line above class copied.
      [ToolboxData("<{0}:GridViewRowClickable runat=server></{0}:GridViewRowClickable>")]
    5. Build project into dll
    6. Copy dll to bin directory of Web Application
    7. Reference dll in Web Application Project
    8. Add controls to toolbox by adding creating a new toolbox item from the dll
    9. Drag and drop control from toolbox into aspx page

    This adds the appropriate Register directive at the top of the aspx page and fixed all the warnings I received. The auto complete also works in this case as well.

    Below is the code.

    <%@ Page Title="" Language="C#" MasterPageFile="~/MyMaster.master" AutoEventWireup="true" Inherits="MyPage" Codebehind="MyPage.aspx.cs" %>
    <%@ Register Assembly="GridViewRowClickable" Namespace="CustomServerControls" TagPrefix="MyTag" %>
    
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
        <asp:SqlDataSource ID="Sql_MyTable" runat="server" ConnectionString="<%$ ConnectionStrings:MyConnectionString %>"
            SelectCommand="spTbl_Select" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
        <egcc:GridViewRowClickable ID="GridViewRowClickable_test" runat="server" 
            DataSourceID="Sql_MyTable" DataKeyNames="tbl_id"
            AllowSorting="True" AutoGenerateColumns="False" GridLines="None" PageSize="25" Width="100%"
            EnableRowClickSelection="true" RowClickCommand="Select" OnSelectedIndexChanged="GridViewRowClickable_test_OnSelectedIndexChanged">
            <Columns>
                <asp:BoundField HeaderText="ID" DataField="tbl_id" SortExpression="tbl_id" />
                <asp:BoundField HeaderText="Name" DataField="tbl_name" SortExpression="tbl_name" />
            </Columns>
            <EmptyDataTemplate>
                No Data.
            </EmptyDataTemplate>
        </egcc:GridViewRowClickable>
    </asp:Content>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 376k
  • Answers 376k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I experimented a bit and here is my version of… May 14, 2026 at 8:27 pm
  • Editorial Team
    Editorial Team added an answer The strtol library function will convert a string representation of… May 14, 2026 at 8:27 pm
  • Editorial Team
    Editorial Team added an answer These are the ASCII values of the character '0', '1'… May 14, 2026 at 8:27 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.