I’m using web project and web forms.
I create Custom Class
Namespace CustomWebControls
Public Class NoValidationDDL
Inherits DropDownList
End Class
End Namespace
and i try to register this class in assembly web.config page section
<controls>
<add tagPrefix="customDDL" namespace="CustomWebControls" assembly="ae" />
</controls>
and try to use in ascx
<customDDL:NoValidationDDL ID ="id" runat="server"></customDDL:NoValidationDDL>
How can i do this in web project?
This should work (assuming the assembly name for your project is
ae) – make sure that you build the project after creating/modifying your custom control. Unless updated ‘ae.dll’ is present in your bin directory, intellisense etc will not work.Instead of modify web.config, you may also try register control at page(aspx) or control(ascx) level by adding register directive after page directive: