I am learning user controls and have just finished my first. The problem is that I struggle to register it in my web configuration and find out its compiler. Right now, this is leading to YSOD regarding the reference to the control.
note: exact error - error Unknown server tag 'cc: LblTextBox'.
Thank!
Web configuration
//..
//..
<pages>
<controls>
<add tagPrefix="cc" namespace="Controls.Server"/>
</controls>
</pages>
</system.web>
Control code
namespace Controls.Server
{
public class LblTextBox : CompositeControl
{
}
}
marked up
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ControlsMain.aspx.cs" Inherits="Pages_ControlsMain" Trace="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Controls Area</title>
</head>
<body>
<form id="form1" runat="server">
<div>
First attempt at a simple composite control <br />
<cc:LblTextBox ID="ccLblTbHybrid" runat="server" LabelText="Name:" />
</div>
</form>
</body>
source
share