WebBroswer Control Problem (Simple 2 lines of code!)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • electroman
    New Member
    • Apr 2008
    • 1

    WebBroswer Control Problem (Simple 2 lines of code!)

    Hello!

    I am having a very weird problem that I cant find any solution on the Internet (after so many years!). I am trying to code a C# program and I am using the WebBroswer control.

    The code is very simple. 1 button and 1 webbroswer control. When the button is clicked I want it to navigate to ebay.com

    Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    
    namespace WindowsFormsApplication1
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
                // This works!
                //webBrowser1.Navigate("http://www.google.com");
                
                // This generates "vshost has stopped working"
                webBrowser1.Navigate("http://www.ebay.com");
                
            }
    
            
        }
    }
    When the ebay.com loads it generates an error saying "vshost has stopped working" and the application closes. Note that this happens 95% of the time. For some reason some times it works!?!

    If however i try google.com it works 100%.

    Now for the strange part. Using the second version of the application that works (i.e. webBrowser1.Nav igate("http://www.google.com" ); ) I search for ebay using google and I manually navigate to ebay.com (meaning I am clicking on the search results link). IT WORKS 100% !

    If anyone can help me I would be grateful. I cant find any other info on this problem. Thank you for reading
  • ShahbazAshraf
    New Member
    • Mar 2008
    • 36

    #2
    Sure ??

    becoz iam using this and its open ebay.com successfully, may be there will be other issue, if know then share with us

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      vshost is only used durring debugging sessions.

      Comment

      Working...