名称属性从.NET中的FORM标记中删除 [英] Name attribute gets removed from FORM tag in .NET

查看:53
本文介绍了名称属性从.NET中的FORM标记中删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何确保.NET不会从HTML表单中删除NAME属性.为了使用AngularJS,我需要这样做.请让我知道.

How do I make sure .NET does not remove the NAME attribute from my HTML forms. I require this in order to use AngularJS. Please let me know.

在visualstudio中,我的表单如下:

in visualstudio my form looks like this:

<form id="scheduleFrm" name="scheduleFrm" runat="server">

但最终在我的浏览器源代码中看起来像这样:

but it ends up looking like this in my browser's source:

<form id="scheduleFrm" method="POST"> without the name attribute

AngularJS需要name属性,但名称可用于我的表单

AngularJS needs the name attribute but name is available for my form

推荐答案

这很糟糕,但是会让您再次尝试:

This is bad but it will get you going again:

<form id="theName" ...>
    <script>document.getElementById("theName").setAttribute("name", "theName");</script>
    <!-- ...formalities -->
</form>

这篇关于名称属性从.NET中的FORM标记中删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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