我想在webbrowser上注入这些命令..我怎么能这样做?
oFormObject = document.forms['formid'];
oFormObject.elements["name"].value = 'Some Value';
document.getElementById('formid').submit();
答案 0 :(得分:1)
您需要阅读ClientScriptManager.RegisterClientScriptBlock。
StringBuilder csText = new StringBuilder();
csText.Append("<script type=\"text/javascript\"> function DoClick() {");
csText.Append("Form1.Message.value='Text from client script.'} </");
csText.Append("script>");
cs.RegisterClientScriptBlock(csType, csName, csText.ToString());