Compilation error by registering of the custom web part

Damir Dobric Posts

Next talks:



Follow me on Twitter: #ddobric




Problem Description:


By implementing of custom web parts based on ASP.NET 2.0, you will probably find many examples, which simple do not work.

One of common problems is that the custom web part is not properly registered in the parent page.


For example, image you implemented the web part in the namespace TextDisplayWebPart. Usually, the web part should be registered at the parent page as shown here:


<%@ Register TagPrefix="part"  Namespace="DaenetGadgetTestWebApplication" %>


Unofortinately, after build process you will get fillowing error:


“Element 'TextDisplayWebPart' is not a known element. This can occur if there is a compilation error in the Web site.”




Solution in this case is more than simple. By registering of the web part in the previous example, the assembly directive is missing:


<%@ Register TagPrefix="part" Assembly="GadgetTestWebApplication" Namespace="GadgetTestWebApplication" %>



Posted Sep 08 2006, 12:29 PM by Damir Dobric
Filed under:


Sasa Popovic wrote re: Compilation error by registering of the custom web part
on 05-07-2008 10:11

A simple article that saved me a lot of time.

Thank you Damir. is a .Net Community Blog powered by daenet GmbH.