Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Defining tagPrefixes in Web.config help

I am having a little bit of trouble getting my aspx pages to recognize my tagPrefixes.

I have the standard ASP ones defined...

<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

Then I have my custom controls defined below that but I do not think I am defining them properly because sometimes the page does not see any controls in the current context other times they work like a champ...

<add tagPrefix="mri" namespace="Mri.Controls" assembly="Mri.Controls"/>
<add tagPrefix="mri" namespace="Mri.Controls.Inputs" assembly="Mri.Controls"/>
<add tagPrefix="mri" namespace="Mri.Controls.Inputs.DropDowns" assembly="Mri.Controls"/>
<add tagPrefix="mri" namespace="Mri.Controls.Inputs.Search" assembly="Mri.Controls"/>

I have one namespace "Mri.Controls" and inside of that namespace I have several sub-folders, "Inputs" -> "DropDowns" etc...

What am I doing wrong? Currently the regular ASP controls are giving me an error: The name "blahBlah" does not exist in the current context.

like image 504
Mike Fielden Avatar asked Oct 14 '22 16:10

Mike Fielden


1 Answers

The sub-folders may or maynot become part of the namespace. By default, Visual Studio does include them when creating new classes but that can be removed in the class. If you moved the controls to the sub-folders, then the folder's name is likely not part of the namespace.

Also, make sure you are referencing your controls assembly or project within Visual Studio.

like image 101
andleer Avatar answered Nov 15 '22 05:11

andleer