Solved

visual studio 2012 register ascx in web config

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now