|
-
Feb 25th, 2009, 04:41 PM
#1
Thread Starter
New Member
[2008] Webbrowser.navigate freezing
I have a simple program with a web browser control and a button that causes it to navigate to a certain web page, as well as an input and another button for entering a url directly.
Everything was working fine until I started messing with the document completed event in the control.
The form loads a url initially and after that 80% of the time it freezes when clicking the button or entering a new url. I deleted the document completed code and now it still freezes a majority of the time.
I cant for the life of me see any pattern in the freeze.
Any ideas?
-
Feb 25th, 2009, 08:36 PM
#2
Re: [2008] Webbrowser.navigate freezing
Does control eventually return to the application or do you have to kill it?
Could it be the navigate is just taking a long time?
-
Feb 26th, 2009, 12:18 PM
#3
Thread Starter
New Member
Re: [2008] Webbrowser.navigate freezing
IT goes not responding and I have to kill it everytime.
-
Feb 26th, 2009, 02:15 PM
#4
Re: [2008] Webbrowser.navigate freezing
Post your code so we can have a look at what might be occurring.
-
Feb 26th, 2009, 02:34 PM
#5
Thread Starter
New Member
Re: [2008] Webbrowser.navigate freezing
The button code:
Code:
Private Sub webreg_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles webreg.Click
pages.SelectTab(tab_webreg)
TextBox1.AppendText("some text")
WebPanel.Navigate("Site to go to")
End Sub
the on load call:
Code:
Private Sub Main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
WebPanel.Navigate("another site")
End Sub
-
Feb 26th, 2009, 02:35 PM
#6
Thread Starter
New Member
Re: [2008] Webbrowser.navigate freezing
It locks up 80% of the time when I click the button which is in the menu bar at the top.
-
Feb 26th, 2009, 03:14 PM
#7
Re: [2008] Webbrowser.navigate freezing
Could it be something with the site you are calling? If you make the site "http://google.com", does it ever crash?
-
Feb 26th, 2009, 03:28 PM
#8
Thread Starter
New Member
Re: [2008] Webbrowser.navigate freezing
I was thinking that might be the issue, but using a url input I have been able to lock it up with several sites.
If it is site specific is there anyway to keep it from crashing the whole program?
-
Feb 26th, 2009, 03:40 PM
#9
Re: [2008] Webbrowser.navigate freezing
If it makes no difference using a few different web pages then I would suggest something radical here...
It would only take a few minutes but try rebuilding the app but with the minimum of code. So open a new project, place a WebBrowser on the form and a button. In the button click event put
WebBrowser1.Navigate("http://www.google.com"),
in the load event put
WebBrowser1.Navigate("http://www.cnn.com").
Does that exhibit the exact same behaviour? If it doesn't then perhaps your existing project is in some way corrupted or there is a property set wrong somewhere.
-
Feb 26th, 2009, 03:40 PM
#10
Re: [2008] Webbrowser.navigate freezing
A few questions here:
Code:
pages.SelectTab(tab_webreg) '<<< what is pages? a TabControl? And you try to select a tabpage?
TextBox1.AppendText("some text") '<<< Where is the textbox? Is it on the same tabpage you selected above? Is there any existing text before you appends some more to it?
WebPanel.Navigate("Site to go to") '<<< Where is WebPanel? Is it on the same tabpgae you selected above?
Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
- Abraham Lincoln -
-
Feb 26th, 2009, 04:11 PM
#11
Thread Starter
New Member
Re: [2008] Webbrowser.navigate freezing
 Originally Posted by stanav
A few questions here:
Code:
pages.SelectTab(tab_webreg) '<<< what is pages? a TabControl? And you try to select a tabpage?
TextBox1.AppendText("some text") '<<< Where is the textbox? Is it on the same tabpage you selected above? Is there any existing text before you appends some more to it?
WebPanel.Navigate("Site to go to") '<<< Where is WebPanel? Is it on the same tabpgae you selected above?
pages is a tabcontrol, and yes i am selecting a tab named tab_webreg
the textbox is on another panel
The textbox does not initially have any text in it, but could if inserted by user
The webbrowser "webpanel" is seperate from the tabpage.
Thanks for the help guys, this is driving me crazy!
-
Feb 26th, 2009, 04:23 PM
#12
Re: [2008] Webbrowser.navigate freezing
Weird, could you try what I suggest in post #9?, that would at least isolate it to something in your code.
-
Feb 26th, 2009, 04:48 PM
#13
Thread Starter
New Member
Re: [2008] Webbrowser.navigate freezing
I will get right on it and post as soon as I do, in the meantime, the main page that I am loading has a log-in. I log in in the normal way, but when I come back to that site it always requires me to log in again.
Is the cookie or session not being set correctly? Any way I can force it to set in the program?
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
|