[英]How can i invoke javascript function within the webbrowser control?
I want my website/webpage to be navigated to a new window which displays the report.Even the Website gets redirected to a login page rather than the report page the moment when the javascript function is invoked.I have given my requirement below.can anybody help me out in finding the solution? 我希望将我的网站/网页导航到一个显示报告的新窗口。即使在调用javascript函数时,该网站也重定向到登录页面而不是报告页面。我在下面给出了我的要求。帮助我找到解决方案?
InvokeScript doesnot work in the following case. 在以下情况下,InvokeScript不起作用。
<a onclick="return showReport('RPTType=SReport');" id="ctl00_tbr_lnkbtnS" class="blckclr" href="javascript:__doPostBack('ctl00$tbr$lnkbtnS','')">S</a>
I used the following statement 我使用了以下语句
webBrowser1.Document.InvokeScript("showReport", new String[] { "RPTType=SReport" });
Thanks in advance.... 提前致谢....
我不确定我是否正确理解了这个问题,但是如果您要使用javascript处理该链接,那么我认为您应该从该链接的onclick
事件返回false
,否则它将执行javascript,然后重定向至href
网址。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.