[RESOLVED] how to stop msgbox opening within webbrowser when connected to website
I am using the webbrowser control in a windows application. when I go to our college website portal and login, do some work, then logout, I get a windows message box Yes/Cancel/Quit that I want to intercept then close browser inside my code. if I click on quit then the browser hangs and does not close.
this is not the AxWebbrowser. is there any way to intercept this message box?
Re: how to stop msgbox opening within webbrowser when connected to website
Well, yes, but this is a tad against the AUP of this site. Can you post some code that you have so far ?
1 Attachment(s)
Re: how to stop msgbox opening within webbrowser when connected to website
sorry about that, there is not much to post for code since this was a simple form1, webbrowser, textbox and a button.
this is the only code:
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
WebBrowser1.Navigate(TextBox1.Text)
End Sub
End Class
when run the program, I type in the url in this case our college portal which requires login credentials, then when I log out of the portal it cause a popup message box as described in previous post. when I click quit since it is required to logout of the portal it hangs up because I did not intercept the message boX from my code. the attached message is shown during hang.
Attachment 32135
Re: how to stop msgbox opening within webbrowser when connected to website
Just checking in to see if anyone can help with this.
Re: how to stop msgbox opening within webbrowser when connected to website
why not just sign out, first. then close the browser
Re: how to stop msgbox opening within webbrowser when connected to website
Quote:
Originally Posted by
dglienna
why not just sign out, first. then close the browser
The portal was written by a web designer who put the messagebox in the logout routine so I do click logout and then it pop's up. Too late then to cancel. I asked the person who wrote it and she said it is required to exit from portal on back end.
Re: how to stop msgbox opening within webbrowser when connected to website
Quote:
Originally Posted by
HanneSThEGreaT
Well, yes, but this is a tad against the AUP of this site. Can you post some code that you have so far ?
I reread the AUP but do not see what you are talking about not posting the code, please enlighten me. Also, I have not found a resolution so can you tell me how to intercept the message box.
Re: how to stop msgbox opening within webbrowser when connected to website
He 'suggested' that you could re-write their page, and send it back, but. Against the AUP and all
Re: how to stop msgbox opening within webbrowser when connected to website
Quote:
Originally Posted by
dglienna
He 'suggested' that you could re-write their page, and send it back, but. Against the AUP and all
Oh. I see and I will not do that. I think their is a way to look at the webbrowser. Document to do this or maybe use the api or something like find the where the window is about to open where I could send the ok response. There should be a way to find out the website sent me the msgbox open request. I can determine the next url by using the mouse click response on the web document.
Re: how to stop msgbox opening within webbrowser when connected to website
Not if it's ASP.Net. Server side code isn't visible
Re: how to stop msgbox opening within webbrowser when connected to website
I talked with the web master who manages our site and it appears that when we logout the portal it causes the message box on exit which states:
"The webpage you are viewing is trying to close the window. Do you want to close this window? YES/NO"
she said this is necessary to close the connection to the website because we use ADFS for single sign on and that will not disconnect until the browser is closed.
she is looking at an alternate method. Is there anyone who can suggest how she should be closing the portal on the ASP side of the house.
This is the code I see when viewing the source from the client browser:
<ie:menuitem id="zz7_ID_Logout" type="option" onMenuClick="STSNavigate2(event,'/_layouts/SignOut.aspx');" text="Sign Out" description="Logout of this site."
Re: how to stop msgbox opening within webbrowser when connected to website
Re: how to stop msgbox opening within webbrowser when connected to website
I asked about it and we dug deeper and found that we are using sharepoint and it has a built in "sign out" routine that we do not know how to modify it.
So I posted a question about this in the SharePoint forum to see if I get a response. Nothing yet.
I will say that this is complete now since there is no way to intercept the popup message box or close the windows when it pops up using VB that I know of.
Thanks to everyone.