SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If I don't add this at the top of my ascx:

<%@ Register Assembly="System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI.WebControls" TagPrefix="asp" %>

Many things go missing out of Intelisense (for example <asp:ListView...). Why do I need to manually register this?

share|improve this question
up vote 0 down vote accepted

The System.Web.UI.WebControls namespace is what contains many of the standard ASP.NET controls. Having that registry at the beginning of the file makes it so the controls under that namespace show up on the asp: tag prefix.

share|improve this answer
Is there a reason this is not just included by default? I can't think of another type of page that requires you to manually ad this. – Abe Miessler Nov 7 '11 at 21:50
It's only the intellisense that is affected. For whatever reason, Visual Studio isn't smart enough to know that ASCX pages should have the same controls available as the ASPX and MASTER pages. My assumption is that it is this way because you can change the TagPrefix on the containing page and it would mess up the ASCX control unless you specifically added it to the control. You can add <asp: tags without registering the control as long as the containing page doesn't interfere with it. You just won't have intellisense. – John Chapman Nov 7 '11 at 22:02
You could register that in the containing page with <cc1: instead of <asp: and it would make the controls fail to render on the ASCX control. Adding the registration to the ASCX control ensures that the tag prefix matches what you used on the control and thus provides intellisense. – John Chapman Nov 7 '11 at 22:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.