简体   繁体   中英

c# web browser control new register

I created a program in c# with webbrowser control that opens a web site and the user will be automatically logged in. That works. However the user should also browse through different web site sections and that's where I get a problem. There is a button on one page "print preview" and what it does in "normal browser" (IE or Mozilla) it opens a new tab and shows the contents. In my program it opens Internet Explorer (it is the default browser) and shows me login page again. Can anyone explain how to open a new tab in my webbrowser control (or new window) and pass login data. Thank you.

It can't be done the way you are trying to do it. There is no concept of tabs in the web browser control. You can verify this by loading up an html page that makes calls to window.open() in javascript. If that call is made it will just launch an instance of IE that navigates to that particular URL.

Your best bet is to have multiple web browser controls and pass data between them. Either that or use HttpWebRequest .

Although, depending on what you are trying to do you may want to automate IE instead.

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