【问题标题】:ASPX engine removing name property from form elementASPX 引擎从表单元素中删除名称属性
【发布时间】:2014-12-13 15:04:50
【问题描述】:

由于某种原因,我有一个混合了 ASPX 和 MVC 页面的应用程序是同一个项目。旧的 aspx 页面用于在生成的 html 中自动呈现 name 元素,例如

<form id="frmMyForm" name="frmMyForm" method="post" action="SomeOtherpage.aspx">

由于某种原因,在新应用程序中,当我们迁移这些 aspx 页面以使用 MVC 页面运行时,缺少 name 属性并且 html 看起来像这样

<form id="frmMyForm" method="post" action="SomeOtherpage.aspx">

有人观察到这种行为并知道它的解决方案吗?我想恢复 name 属性,因为它在我的 javascript 应用程序中被大量使用,并且找出所有位置并不容易。

【问题讨论】:

标签: html properties webforms webforms-view-engine


【解决方案1】:

经过大量搜索,我找到了解决方案。它与 web.config 中控制表单名称的 xhtmlconformance 元素有关 - 检查此链接 - Form-tag-doesn-t-have-name-attribute-htmlconformance.aspx

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-11
    • 1970-01-01
    • 2018-07-06
    • 2021-09-18
    • 2015-03-02
    • 2018-01-25
    相关资源
    最近更新 更多