webBrowser popup window loses session

早过忘川 提交于 2019-12-24 07:37:07

问题


I am using WebBrowser control of .NET to login into a website. When i click on a button that popups a new window the popup window asks me to login again. However i am not asked to login again if i open the webpage in internet explorer. Is there any way to make the WebBrowser control store session so that i do not have to login again on the popup window.


回答1:


To maintain the session state you can use the NewWindow2 event to open the new page in another form in the application; the event is triggered by the WebBrowser control.

See How to use the WebBrowser control NewWindow2 event in Visual C#




回答2:


before clicking that button are you already made login?just asking.

in both cases i think solution which i am going to give will work for you.

for this purpose i think you place login fields in panel and on page_load check either session empty or not if not then visible it false if yes then visible it true.

Hope you find the answer.



来源:https://stackoverflow.com/questions/2941848/webbrowser-popup-window-loses-session

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!