I’m able to this on an aspx page by importing the right namespace:
<c:tabcontrol runat="server" id="ContactTabs" activepage="ClientTab" class="vertical">
Both of these imports work; what’s the difference and should I use one over the other?
<%@ Import Namespace="Tridion.Web.UI" %>
vs.
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://www.sdltridion.com/web/ui/controls"
class="tridion popup">
When just using the xmlns attribute, Visual Studio gives
Warning Validation (XHTML 1.0 Transitional): Attribute ‘class’ is not
a valid attribute of element ‘html’.
For c:tabcontrol to work, you need to register the tag prefix c:
In older versions of ASP.NET you had to do this in the page with an @Register directive. This would allow you to associate a .NET namespace and assembly with a tag prefix. Nowadays, you can register the prefix in web.config, which is more convenient, but the principle remains the same.
Once you have the prefix wired up, ASP.NET will recognise tags with that prefix as controls. (Note the runat=”server” attribute on your tabcontrol)
Your second example is an XML namespace, not a .NET namespace.