March 2, 2012

Include the sc namespace

When you have multiple projects in a single solution you will maybe have this error message when you try to use some sitecore controls like the sc:Text:

You have to simple solutions to fix this problem:

You may add this line on the top of each files:
<%@ Register Assembly="Sitecore.Kernel" Namespace="Sitecore.Web.UI.WebControls" TagPrefix="sc" %>


Or you may add a web.config into your project with the minimal information to include this namespace.
But don’t deploy this web.config in your solution because it will override the correct sitecore web.config
<?xml version="1.0"?>
<configuration>
  <system.web>
    <pages validateRequest="false">
      <controls>
        <add tagPrefix="sc" namespace="Sitecore.Web.UI.WebControls" assembly="Sitecore.Kernel" />
        <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" />
        <add tagPrefix="sc" namespace="Sitecore.Web.UI.WebControls" assembly="Sitecore.Analytics" />
      </controls>
    </pages>
  </system.web>
</configuration>

3 comments:

  1. Hello there, I discovered your blog by way of Google even as looking for a related matter, your website got here up, it appears to be like great. I’ve bookmarked it in my google bookmarks.
    Toolbar Editor

    ReplyDelete
  2. Hello there, you've a great blog. very useful information. I have a question on DMS. On our website, a visitor may have several accounts. How do we save these accountIds into DMS? We have around 1000s of accounts. We need to
    view the statistics generated by visitors on each account and
    evaluate the value achieved by an account.
    The problem is visitor may switch from one account to another within the same session. the accounts are not unique to any page or page flow. They are not unique to Sitecore Items on the Content tree. How can DMS help to get engagment analytics reports on these accounts? Is this at all possible on DMS?

    ReplyDelete
  3. This comment has been removed by a blog administrator.

    ReplyDelete