简体   繁体   English

使用c#(WebBrowser控件)在javascript中触发Click事件

[英]Trigger a Click event in javascript using c#(WebBrowser control)

Is there any way to call the click function from the c# application 有什么方法可以从C#应用程序调用click函数

Here's the code that set the function: 这是设置函数的代码:

$('#connectbtn').unbind('click').attr('disabled', false);
            $('#connectbtn').bind('click', function() {
               //CODE TO BE EXECUTED
            }).removeAttr('disabled');

try it, 试试吧,

ClientScript.RegisterStartupScript(this.GetType(), "DateTimeFromServer", string.Format(@"<script>  
                                                                                $(function () {{
                                                                                        $('#connectbtn').trigger('click','{0}');
                                                                                    }});
                                                                          </script>", DateTime.Now));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM