Solution: "Element '%' is not a known element. This can occur if there is a compilation error in the

H

hirebrian

If you run accross the error message:

"Element '%' is not a known element. This can occur if there is a
compilation error in the Web site"

where '%' is the value of the tagName attribute on a web user control
you have delcared in your web.config file, then you might try
prefixing your src attribute value with the ~ (tilda) character. As
you probably know, this character tells ASP.NET to resolve the path
from the application root.

So instead of using:

<add tagPrefix="MyPrefix" tagName="MyName" src="/UserControls/
MyControl.ascx" />

use:

<add tagPrefix="MyPrefix" tagName="MyName" src="~/UserControls/
MyControl.ascx" />

A few people have posted about this and hadn't found a solution.

Anyway, it solved my problem and figured I would post it.

Thanks,
BJS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top