1

Hi I've registered a user control on the top of an appx control.

<%@ Register Src="../Controls/Attachments.ascx" TagName="Attachments" TagPrefix="uc7" %>
<%@ Register Src="../Controls/Help.ascx" TagName="Help" TagPrefix="uc8" %>
<%@ Register Src="~/Controls/WRControls/WRDetails.ascx" TagName="WR" TagPrefix="uc9"  %>

Unfortunately when I try to call the new user control. i.e

"<uc9:WR" (uc9:WR does not appear in the ittelisense drop down) for the new user control which I've added.

The base user control is under a different file path to other user controls. As you can see above.

As i'm unable to find the user control in the intellisense I can then not add the control to the aspx page.

I've tried all sorts onthe base control i.e deleting all code in the designer.cs page then cutting and re-pasting the html to re-generate the designer.cs page all to no avail.

Justin Bone
  • 11
  • 1
  • 3

1 Answers1

0

Register your user control in the web.config file as shown in this article:

http://weblogs.asp.net/scottgu/archive/2006/11/26/tip-trick-how-to-register-user-controls-and-custom-controls-in-web-config.aspx

Under <pages> in the web.config file, add a <controls> block as follows:

<?xml version="1.0"?>

<configuration>

  <system.web>

    <pages>
      <controls>
        <add tagPrefix="scottgu" src="~/Controls/Header.ascx" tagName="header"/>
        <add tagPrefix="scottgu" src="~/Controls/Footer.ascx" tagName="footer"/>
        <add tagPrefix="ControlVendor" assembly="ControlVendorAssembly"/>
      </controls>
    </pages>

  </system.web>

</configuration>
Ortund
  • 8,095
  • 18
  • 71
  • 139
Sean Airey
  • 6,352
  • 1
  • 20
  • 38
  • 1
    You probably know by now that answers with only a link are considered low quality. The link can change or die and then where are other users left? Staring at your [once useful] answer with nothing but frustration and tears in their eyes... – Ortund Jul 05 '17 at 13:53