468,772 Members | 1,796 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,772 developers. It's quick & easy.

WebBroswer Control Problem (Simple 2 lines of code!)


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

Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  10. namespace WindowsFormsApplication1
  11. {
  12.     public partial class Form1 : Form
  13.     {
  14.         public Form1()
  15.         {
  16.             InitializeComponent();
  17.         }
  19.         private void button1_Click(object sender, EventArgs e)
  20.         {
  21.             // This works!
  22.             //webBrowser1.Navigate("http://www.google.com");
  24.             // This generates "vshost has stopped working"
  25.             webBrowser1.Navigate("http://www.ebay.com");
  27.         }
  30.     }
  31. }
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.Navigate("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
Apr 7 '08 #1
2 1202
Sure ??

becoz iam using this and its open ebay.com successfully, may be there will be other issue, if know then share with us
Apr 8 '08 #2
7,872 Expert 4TB
vshost is only used durring debugging sessions.
Apr 8 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Curious | last post: by
22 posts views Thread by Tommy | last post: by
3 posts views Thread by candy | last post: by
reply views Thread by M Wagner | last post: by
reply views Thread by MS Newsgroups | last post: by
1 post views Thread by shenhaipeng | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
2 posts views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.