【问题标题】:Request.Form is nothing when the object is disabled当对象被禁用时,Request.Form 什么都不是
【发布时间】:2014-05-28 00:14:55
【问题描述】:

我用谷歌搜索并在这里和谷歌中搜索每一篇文章,但我找不到任何关于这个问题的信息。知道为什么当 html 控件被禁用时 request.form["name here"] 什么都不是

<input  type="radio"  name="name here" disabled /> 

删除禁用将返回值。我只在 IE 10 上测试过,不确定在其他浏览器上。

我正在考虑更改单选按钮的 CSS,但这是另一回事。

谢谢。

【问题讨论】:

标签: asp.net


【解决方案1】:

禁用的表单字段不是发布数据的一部分。如果禁用 html 控件,则不会发布数据。

如果您想显示数据并将其发布,但无法编辑,您可以将控件设置为只读。

<input  type="radio"  name="name here" readonly="readonly" /> 

【讨论】:

  • 感谢您的回答
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-06-27
  • 1970-01-01
  • 1970-01-01
  • 2010-09-05
  • 2011-07-12
  • 1970-01-01
相关资源
最近更新 更多