【问题标题】:ASP.NET matching id on label and input pairs标签和输入对上的 ASP.NET 匹配 id
【发布时间】:2011-06-24 18:28:55
【问题描述】:

一个页面上有大约 20 个标签/输入对,它们使用 JS 赋予它们独特的样式。为此,它们必须在每对上都有匹配的 id。

这就是我希望 HTML 被格式化的方式:

<p class="radioBtn">
    <label for="business00"></label>
    <input id="business00" type="radio" name="radioBtn" value="" />
</p>
<p class="radioBtn">    
    <label for="private00"></label>
    <input id="private00" type="radio" name="radioBtn" value="" />
</p>
<p class="radioBtn">
    <label for="business01"></label>
    <input id="business01" type="radio" name="radioBtn" value="" />
</p>
<p class="radioBtn">    
    <label for="private01"></label>
    <input id="private01" type="radio" name="radioBtn" value="" />
</p>

等等。

这可以使用 ASP.NET 实现吗?非常感谢。

【问题讨论】:

标签: asp.net input label


【解决方案1】:

我想this 会回答你的问题。

【讨论】:

  • 基本上只用“AssociatedControlID”
猜你喜欢
  • 1970-01-01
  • 2020-12-08
  • 2020-07-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多