繁体   English   中英

练习web.config并出现错误

[英]Practicing web.config and getting error

我从这里练习web.config文件
当我复制并粘贴以下代码时

<configSections>
  <section name ="ProductSection" type ="<ProductSection" />
</configSections>

<ProductSection>
<gridSettings title ="Latest Products" count ="20"></gridSettings>
<color background="FFFFCC" foreground="FFFFFF"></color>
</ProductSection>

我遇到了一些错误,例如:

  • 标签未在第二行关闭。
  • </section>丢失。
  • 名称空间'section'不能包含子元素。

如何清除这些错误并使其平稳运行。

代替

<section name ="ProductSection" type ="<ProductSection" />

尝试

<section name ="ProductSection" type ="&lt;ProductSection" />

请参阅HTML和XML的特殊字符是什么?

你有这个:

type ="<ProductSection"

这在XML中无效,请删除“ <”字符:

<section name ="ProductSection" type ="ProductSection" />

如果实际上带有“ <”的内容,则必须像这样编码:

<section name ="ProductSection" type ="&lt;ProductSection" />

但是,由于实际部分是<ProductSection> ,因此可能只是您这边的错字。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM