-
November 26th, 2013, 08:13 PM
#1
[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?
-
November 27th, 2013, 10:46 AM
#2
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 ?
-
November 27th, 2013, 04:17 PM
#3
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.
-
November 30th, 2013, 09:42 PM
#4
Re: how to stop msgbox opening within webbrowser when connected to website
Just checking in to see if anyone can help with this.
-
December 1st, 2013, 02:41 AM
#5
Re: how to stop msgbox opening within webbrowser when connected to website
why not just sign out, first. then close the browser
-
December 1st, 2013, 06:46 AM
#6
Re: how to stop msgbox opening within webbrowser when connected to website
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.
-
December 1st, 2013, 06:57 AM
#7
Re: how to stop msgbox opening within webbrowser when connected to website
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.
-
December 1st, 2013, 09:44 PM
#8
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
-
December 2nd, 2013, 06:40 AM
#9
Re: how to stop msgbox opening within webbrowser when connected to website
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.
-
December 2nd, 2013, 01:07 PM
#10
Re: how to stop msgbox opening within webbrowser when connected to website
Not if it's ASP.Net. Server side code isn't visible
-
December 4th, 2013, 09:45 AM
#11
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."
-
December 4th, 2013, 12:24 PM
#12
Re: how to stop msgbox opening within webbrowser when connected to website
-
December 4th, 2013, 12:37 PM
#13
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|