简体   繁体   中英

webBrowser1.Navigate (“javascript:__doPostBack('…')”); on C#.NET is not working

I am working on a C#-based application that navigates to the URL that I want using WebBrowser Control. But when I insert a linklabel1 inside my Form1.cs [Design] and code it to navigate the same as the link label found on the URL I want, which is...

javascript:__doPostBack('_ctl0$PlaceHolderMain$Loginapp2$lnkforgot','')

In my coded linklabel1_Click, it is:

weBrowser1.Navigate("javascript:__doPostBack('_ctl0$PlaceHolderMain$Loginapp2$lnkforgot','')";

It does nothing at all, the page remains constant, I get no status indicator that the webpage is being navigated. Any suggesstions?

webBrowser1.Document.InvokeScript("__doPostBack", new object[] { "_ctl0$PlaceHolderMain$Loginapp2$lnkforgot", "" });

这是你想要的吗?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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