Why does ASP.NET auto-generated .designer code have the incorrect type?

两盒软妹~` 提交于 2019-11-30 22:14:30

Because the project doesn't start at the application root, you have to tell the project where the real application root is before it will be able to resolve the ~ correctly. Go into the Web tab of the project's properties, and make sure that "Use Local IIS Web server" is selected under the "Servers" header. Set the Project URL to the URL to your specific project (i.e. http://localhost/DotNetNuke_2/DesktopModules/Events). Then, check the Override application root URL and set that to the application's root URL (i.e. http://localhost/DotNetNuke_2). This will allow the web application project to know how to find those controls.

The Src attribute is relative to the control, so it should work fine to just set it to "EventIcons.ascx" rather that specifying it from the root of the application.

~ resolves to the root of the application folder.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!