Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/409.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 为什么我不能使用“Invokemember”(“click”)`以编程方式单击我的按钮?_C#_Javascript_Asp.net_Webbrowser Control - Fatal编程技术网

C# 为什么我不能使用“Invokemember”(“click”)`以编程方式单击我的按钮?

C# 为什么我不能使用“Invokemember”(“click”)`以编程方式单击我的按钮?,c#,javascript,asp.net,webbrowser-control,C#,Javascript,Asp.net,Webbrowser Control,我正试图通过WebBrowserControl从应用程序中的网站获取数据。我可以成功登录,但当我以编程方式调用btnsearch.Invokemember(“单击”)时,我收到一个JavaScript错误。如果我以交互方式单击WebBrowserControl上的按钮,则不会收到任何错误,一切正常 在aspx页面中,我有一个JavaScript函数用于调用Ajax面板: <script type="text/javascript"> /*<![CDATA[*/ windo

我正试图通过
WebBrowserControl
从应用程序中的网站获取数据。我可以成功登录,但当我以编程方式调用
btnsearch.Invokemember(“单击”)
时,我收到一个JavaScript错误。如果我以交互方式单击
WebBrowserControl
上的按钮,则不会收到任何错误,一切正常

在aspx页面中,我有一个JavaScript函数用于调用Ajax面板:

<script type="text/javascript">
/*<![CDATA[*/   
window["ctl00_WorkSpace_ctlCustAVIHistory_ajxResultPanel"] = new RadAjaxPanelNamespace.RadAjaxPanel({ClientID:"ctl00_WorkSpace_ctlCustAVIHistory_ajxResultPanel",EnableOutsideScripts:false,EnablePageHeadUpdate:true,Url:"/app/ModuleCustomer/ViewAVITransactions.aspx",LoadingPanelID:"ctl00_WorkSpace_ctlCustAVIHistory_LoadingPanel1",ActiveElementID:"",ClientEvents:{OnRequestStart:"",OnRequestSent:"",OnResponseReceived:"",OnResponseEnd:""},FormID:"aspnetForm",UniqueID:"ctl00$WorkSpace$ctlCustAVIHistory$ajxResultPanel"});/*]]>*/
</script>
知道为什么会这样吗

    private const string STR_Field_userid = "field_userid";
    private const string STR_Field_password = "field_password";
    private const string STR_Submit = "submit";            

        document.GetElementById(STR_Field_userid).InnerText = UserId;
        document.GetElementById(STR_Field_password).InnerText = Password;
        document.Forms[0].InvokeMember(STR_Submit);
    private const string STR_Field_userid = "field_userid";
    private const string STR_Field_password = "field_password";
    private const string STR_Submit = "submit";            

        document.GetElementById(STR_Field_userid).InnerText = UserId;
        document.GetElementById(STR_Field_password).InnerText = Password;
        document.Forms[0].InvokeMember(STR_Submit);