views:

1300

answers:

2

Hi,

I have this set up...

<%@ Register TagPrefix="UserControl" 
             TagName="UserLogin" 
             Src="~/admin/Authentication/Login.ascx" %>
<%@ Register TagPrefix="UserControl"
             TagName="UserRegister"
             Src="~/admin/Authentication/Register.ascx" %>

Then later on in the same file I use the tags...

<div id="LoginContainer"><UserControl:UserLogin runat="server /></div>
<div id="RegisterContainer"><UserControl:UserRegister runat="server" /></div>

And for some reason, the UserControl:UserRegister gets underlined in green, when I hover over it, it says "Element 'UserRegister' is not a known element. This can occur if there is a compilation error in the website or if the web.config file is missing."

Is there something else I need to do to make these tags work other than just registering them at the top of the page?

+1  A: 

No, You did everything.

What you want to make sure from are:

1- Build your project.

2- Make sure there are no errors in the controls.

3- Make sure there is no errors in the web.config.

4- Make sure from the paths you wrote in the Register line that it points to the right controls.

And try to run the web page, may be VS cache something and keeps it green underlined, so try to see the page in run mode.

Amr ElGarhy
+1  A: 

The tag is registration is correct. The error is self-explanatory.

"Element 'UserRegister' is not a known element. This can occur if there is a compilation error in the website or if the web.config file is missing."

Build your project and check where the compilation errors for the usercontrols are.

ichiban