0

I'm trying to implement the custom radio control solution from this SO post. Retrieve value for selected radiobutton in ListView asp.net in a Web Application project using VS 2013.

I keep receiving the annoying message that the ListRadioButton is not a known element and that this can occur if there's a compilation error. I have not received any compilation errors except when trying the view the page I receive "Unknown server tag 'site:ListRadioButton'"

My .aspx page

 <site:ListRadioButton ID="resultinglist" runat="server"
     GroupName="resultids"
     Text='<%# Eval("id") %>' />

My web.config file:

<system.web>
    <pages>
      <controls>
        <add
            tagPrefix="site"
            namespace="SiteControls"
                />
      </controls>
    </pages>
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
  </system.web>

Custom Control from original SO post is unchanged, but here's a snippit:

namespace SiteControls
{
    [ToolboxData("<{0}:ListRadioButton runat=\"server\" />")]
    public class ListRadioButton : RadioButton
    {
    ...

I've tried several solutions, most of them included in the original post none of which seem to work for me:

  1. Adding registration directive at the top of the .aspx page.
  2. Adding the registration in my web.config.
  3. Creating a new "Empty Web Application", adding the single .cs file to the project and compiling, then registering the new DLL.
  4. Looking for files that needed deleted out of the user profile folders (ReflectedSchemas).

Currently, I'm configured with the custom control as another class file in my main project.

I'm not sure where my error is or what to look for next. Any help would be greatly appreciated.

Thank you.

Community
  • 1
  • 1
Trebor
  • 793
  • 3
  • 11
  • 37

1 Answers1

1

After multiple googling attempts, I found another post with a similar solution here but I noticed he added the keyword Assembly="xxx" to his registration tag. After adding the key word and the name of the DLL that contains my new custom control, everything works fine. Now my .aspx page contains the following line and everything works great.

<%@ Register TagPrefix="site" Namespace="SiteControls" Assembly="CustomControls" %>
Trebor
  • 793
  • 3
  • 11
  • 37