Solved

visual studio 2012 register ascx in web config

Posted on 2015-01-15
5
376 Views
Last Modified: 2015-01-30
I use visual studio 2012 to build web application project (not website) and  register ascx in web config.
e.g.

<add tagPrefix="Controls" tagName="footer" src="~/controls/Footer.ascx"/>
       
However, the webpage aspx does not recognizes the control. No idea why.
It works fine in visual studio 2010.
0
Comment
Question by:ITsolutionWizard
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 8

Expert Comment

by:Naitik Gamit
ID: 40552863
For VS2012, you need to remove the asp tagprefixes, so the section ends up being

in web.config:

<pages validateRequest="false">
  <controls>
    <add tagPrefix="sc" namespace="Sitecore.Web.UI.WebControls" assembly="Sitecore.Kernel" />
    <add tagPrefix="sc" namespace="Sitecore.Web.UI.WebControls" assembly="Sitecore.Analytics" />
  </controls>
</pages>
0
 
LVL 1

Author Comment

by:ITsolutionWizard
ID: 40554478
I do not know what you mean. so if i have below ascx registration. what do i need to change?

<add tagPrefix="Controls" tagName="footer" src="~/controls/Footer.ascx"/>
0
 
LVL 8

Expert Comment

by:Naitik Gamit
ID: 40554769
Try Like:

<configuration>

  <system.web>

    <pages>
      <controls>
        <add tagPrefix="sc" src="~/locationofcontrol" tagName="sitecore"/>
      </controls>
    </pages>

  </system.web>

</configuration>

Also Read This:
http://haacked.com/archive/2006/11/14/register_custom_controls_in_web.config.aspx/
0
 
LVL 8

Expert Comment

by:Naitik Gamit
ID: 40554771
0
 
LVL 8

Accepted Solution

by:
Naitik Gamit earned 500 total points
ID: 40554773
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question