VS 2005构建失败,ASPX文件,包括 [英] VS 2005 fails to build aspx files with includes

查看:167
本文介绍了VS 2005构建失败,ASPX文件,包括的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的ASP开发。
我工作的该项目在.INC文件中大部分重复头ASP code的,沿着线的东西:

I'm new to the ASP development. The project I'm working on has most of the repeated header asp code in an .inc file, something along the lines of:

<!--#include virtual="header.inc"-->
<body><!-- body is closed in footer.inc -->

<!-- ... -->

<!--#include virtual="footer.inc"-->

建筑时,VS是报告了不少的错误,如:

When building, VS is reporting quite a lot of errors like:

错误310验证(XHTML 1.1):元素体是其失踪
  关闭标签。 ------ ------ PAGE_NAME 13

Error 310 Validation (XHTML 1.1): Element 'body' is missing its closing tag. ------page_name------ 13

我认为,包括被列入验证页面从而增加适当的结束标记之前。
没有人有任何想法,为什么会发生这种情况?我错过任何配置?

I thought the includes were included before validating the page thus adding the appropriate closing tag. Does anyone have any idea why this would happen? Am I missing any configuration?

感谢

推荐答案

服务器端包含由IIS支持(这样他们就可以使用!),但.NET不涉及这包括在所有。因此,页眉和页脚将要增加在游戏太晚了。

Server Side Includes are supported by IIS(so they can be used!) but .NET is not involved with this include at all. So the header and footer are going to be added too late in the game.

去这里的更多信息:
http://www.dotnetperls.com/ssi

。看看MasterPages如果你想避免重复XHTML。这是完美的页眉和页脚。

Look into MasterPages if you're trying to avoid duplicating XHTML. This is perfect for headers and footers.

此外,我怀疑你将需要知道的元素需要包含RUNAT,为了在code后面asp.net/referenced~~V用于ID属性。

Also I suspect that you're going to need to know that elements will need to contain "runat" and "Id" attributes in order to be used in asp.net/referenced in the code behind.

这篇关于VS 2005构建失败,ASPX文件,包括的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆