将独立的 ASPX 页面添加到现有的 Web 应用程序 (.Net 3.5)
我下载了 这篇文章 并尝试将其“放入”生产网站,但当我尝试访问它时出现以下错误通过我的 Web 浏览器:
[HttpException (0x80004005): 文件 '/WebResources.aspx' 尚未预编译,无法请求。]
如果我将文件放入本地计算机上的 webs 中,它运行正常。如何预编译这个单个文件而不重新发布整个应用程序?我可以做些什么来预编译这一页吗? (注意:它不引用任何外部控件、母版页等)
I downloaded the file discussed in this article and tried "dropping it into" a production web site, but got the following error when I tried to access it through my Web browser:
[HttpException (0x80004005): The file '/WebResources.aspx' has not been pre-compiled, and cannot be requested.]
If I drop the file into webs on my local machine, it runs fine. How do I pre-compile this single file without re-publishing the whole application? Is there something that I can do to pre-compile just this one page. (Note: It doesn't reference any external controls, Masterpages, etc.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这很容易做到。
完毕。这个新文件现在可以访问其他网络应用程序所做的一切。
This is pretty easy to do.
Done. This new file now has access to everything your other web app does.
针对您的问题的一种懒惰解决方案(不检查错误来源)是查看 iFrame 内的页面。
但是如果您需要该页面与其范围之外的控件进行交互,那么您将需要查看 ASPX 的标头部分并确保它继承自正确的类,并且是调用该页面的 Web 项目的一部分页。
One lazy solution for your problem (without checking the source of the error) is to view the page inside an iFrame.
but if you need that page to interact with controls outside of its scope, then you will need to look into the header part of the ASPX and make sure that it inherits from the proper class, and is part of the Web Project that is calling the page.