Solved

visual studio 2012 register ascx in web config

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

911 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

23 Experts available now in Live!

Get 1:1 Help Now