Results 1 to 13 of 13

Thread: [2008] Webbrowser.navigate freezing

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Posts
    11

    [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?

  2. #2
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    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?

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Posts
    11

    Re: [2008] Webbrowser.navigate freezing

    IT goes not responding and I have to kill it everytime.

  4. #4
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,950

    Re: [2008] Webbrowser.navigate freezing

    Post your code so we can have a look at what might be occurring.

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Posts
    11

    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

  6. #6

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Posts
    11

    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.

  7. #7
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    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?

  8. #8

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Posts
    11

    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?

  9. #9
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,950

    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.

  10. #10
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    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 -

  11. #11

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Posts
    11

    Re: [2008] Webbrowser.navigate freezing

    Quote 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!

  12. #12
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,950

    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.

  13. #13

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Posts
    11

    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
  •  



Click Here to Expand Forum to Full Width