我在 asp.net 中有一个网站,我正在创建 AMP 页面http://mywebsite.com/amp/......
除了以下错误之外,我能够对 AMP 进行所有必要的更改。
属性“action”可能不会出现在标签“FORM [method=POST]”中
我网站中的 Form 标签看起来像这样
<form name="form1" method="post" id="form1">
AMP 教程建议使用action-xhr=/default.aspx
而不是action="default.aspx
这是来源:https ://ampbyexample.com/components/amp-form/
现在,问题是如何action-xhr
在 asp.net 中删除操作属性和添加属性。
我在cs文件中尝试了以下代码,但没有运气。
this.Page.Form.Attributes.Remove("action");
请注意JavaScript
,jQuery
不允许在 AMP 中使用