0

VB.NET webbrowser 控制器无法在文本框中设置值

<input name="ctl00$ContentPlaceHolder1$txtUsername" type="text" id="ctl00_ContentPlaceHolder1_txtUsername" style="width:95%;" class="TextBoxWatermark" autocomplete="off">

更多信息

var Page_Validators =  new Array(document.getElementById("ctl00_ContentPlaceHolder1_RequiredFieldValidator1"), document.getElementById("ctl00_ContentPlaceHolder1_RequiredFieldValidator2"));

更多信息

document.getElementById('ctl00_ContentPlaceHolder1_RequiredFieldValidator1').dispose = function() {
Array.remove(Page_Validators, document.getElementById('ctl00_ContentPlaceHolder1_RequiredFieldValidator1'));

}

更多信息

Sys.Application.add_init(function() {
$create(AjaxControlToolkit.TextBoxWatermarkBehavior, {"ClientStateFieldID":"ctl00_ContentPlaceHolder1_txtUsernameWatermarkExtender_ClientState","WatermarkCssClass":"TextBoxWatermark","WatermarkText":"ตัวอย่าง mj99u53xxxxxxxx","id":"ctl00_ContentPlaceHolder1_txtUsernameWatermarkExtender"}, null, null, $get("ctl00_ContentPlaceHolder1_txtUsername"));

});

和更多

document.getElementById('ctl00_ContentPlaceHolder1_RequiredFieldValidator2').dispose = function() {
Array.remove(Page_Validators, document.getElementById('ctl00_ContentPlaceHolder1_RequiredFieldValidator2'));

}

我试过这段代码

webBrowser1.Document.All.GetElementsById("ctl00_ContentPlaceHolder1_txtUsername").SetAttribute("Value", "xxxxx");

这是行不通的

4

1 回答 1

1

尝试:

webBrowser1.Document.GetElementsById("ctl00_ContentPlaceHolder1_txtUsername").SetAttribute("Value", "xxxxx");

没有All财产。

于 2013-03-06T10:40:17.553 回答