Solved

visual studio 2012 register ascx in web config

Posted on 2015-01-15
5
367 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
  • 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
 

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

772 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