Because this control is registered in Web. config and is in the same directory as the page

Source: Internet
Author: User

The user control is configured in the Web. config file

< pages >    < Controls >        <  tagPrefix= "my"  tagName= "Login"  src= "~/ Login.ascx "/>    </controls></  Pages>

The control is then referenced in the ASPX page

<runat= "Sever"  ID= "MyLogin"/>

Throws an exception "because this control is registered in Web. config and is in the same directory as the page"

Cause of Error:

Controls that are registered in Web. config cannot be in the same sibling directory as the calling page

Workaround:

1, for the Ascx and ASPX in the same directory, directly in the page regist

2. Place all ascx in a directory that is never likely to be the same as any ASPX file, such as controls

Original address: http://www.zizhusoft.com/note/show.aspx?id=1aad22ce-d39d-4d3b-b785-f2b17b481854

Because this control is registered in Web. config and is in the same directory as the page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.