1

This is how a register the control on the page:

<%@ Register TagPrefix="uc" TagName="Pcp" Src="../../Controls/ClientPayement.ascx" %>

And this is how I use it:

<uc1:Pcp ID = "pcpClient1"></uc1:Pcp> 

I don't know why uc1 has a green underline warning. When I hover over it, it says: "Unrecognized namespace uc1". And the user control is not displaying on the page.

Am I missing something? Yet this tutorial says that this is all I need to do.

1
  • "uc1" is not the same thing as "uc" Commented May 23, 2013 at 22:58

2 Answers 2

5

You are specifying a uc prefix in <%@ Register TagPrefix="uc" .. so that's the one you should use:

<uc:Pcp ID = "pcpClient1"></uc:Pcp> 

Or you could change the declared prefix:

<%@ Register TagPrefix="uc1" TagName="Pcp" Src="../../Controls/ClientPayement.ascx" %>

And use the control as you posted in the question:

<uc1:Pcp ID = "pcpClient1"></uc1:Pcp> 

EDIT

As Shai Cohen pointed out in another answer, you are also missing the runat="server" from the usercontrol tag.

<uc1:Pcp ID = "pcpClient1" runat="server"></uc1:Pcp> 
Sign up to request clarification or add additional context in comments.

Comments

0

In addition to Juan's answer, you are also missing runat="server".

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.