开发者

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?

InvokeScript doesnot work in the following case.

<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("showRepor开发者_Python百科t", new String[] { "RPTType=SReport" }); 

Thanks in advance....


I'm not sure I understand the question correctly, but I would think you should return false from the onclick event of the link if you're going to handle it with javascript, otherwise it will execute the javascript and then redirect to the href url.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜