【问题标题】:how to change a property of an input tag in C#如何在 C# 中更改输入标记的属性
【发布时间】:2013-07-25 18:51:04
【问题描述】:

我正在使用 C# Web 浏览器控件。 输入标签如下:

input id="txtText" class=" ImageAttached" type="text" style="width:100px;" name="txtText"  image_attached="true"

如何将 image_attached 更改为 false。

我正在使用以下代码,但图像仍然附加。

  elements = webBrowser1.Document.GetElementById("txtText");
        if (elements != null)
             {                     
                 elements.SetAttribute("image_attached", "false");
              }

【问题讨论】:

  • 这很模糊。
  • 你说“输入标签如下:”,剩下的句子在哪里?

标签: c# html tags webbrowser-control


【解决方案1】:

尝试使用调试器在分配上设置断点,跳过它,看看你的 SetAttribute 方法是否被调用。如果该语句从未得到满足,那么您上面的分配就有问题。

【讨论】:

    猜你喜欢
    • 2013-12-22
    • 2021-08-23
    • 2018-03-15
    • 1970-01-01
    • 2013-05-17
    • 1970-01-01
    • 1970-01-01
    • 2017-09-20
    • 2018-08-13
    相关资源
    最近更新 更多