Compile Web User Control to Custom Control namespace name could not be found?

StackOverflow https://stackoverflow.com/questions/10329897

  •  03-06-2021
  •  | 
  •  

سؤال

Example aspx code:

my sample code

<%@ Register TagPrefix="XF" Namespace="MyNameSPace" %>

i want to register the tag in my controls, but why it said the namespace could not be found? any ideal?

هل كانت مفيدة؟

المحلول

You are either missing the assembly attribute or you are trying to register a usercontrol without the src attribute:

Real world working examples from a current project of mine:

A user control (.ascx):

<%@ Register TagPrefix="uc1" TagName="FooDialog" Src="FooDialog.ascx" %>

A webcontrol (defined in a class with no designer file):

<%@ Register TagPrefix="ie" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %>
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top