Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello guys
well i tried to display google maps in my application using c#
well it works at the first sight but than it shows me errors
"an error displayed in the script of this page" and it asked me if i want to continue or not even when i click on yes it shows again . so what should i do ?
thanks guys

What I have tried:

string corx = textBox1.Text;
            string cory = textBox2.Text;
            try
            {
                StringBuilder str = new StringBuilder();
                str.Append("https://www.google.com/maps/@");

                if(corx != string.Empty)
                {
                    str.Append(corx + "," + "+");
                }
                if (cory != string.Empty)
                {
                    str.Append(cory + "," + "+");
                }
                webBrowser1.Navigate(str.ToString());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString(), "Error !");
            }
Posted
Updated 18-May-20 4:25am
Comments
Richard MacCutchan 16-May-20 12:03pm    
You will need to look at the script that gives the error to find out what is happening.

The WebBrowser control is stuck in IE7 mode by default, unless you change the registry on every computer which runs your application:
Web Browser Control & Specifying the IE Version - Rick Strahl's Web Log[^]

Google Maps will not work in any version of Internet Explorer prior to IE10. And even then, support for IE10 will be dropped very soon - the plan was originally to drop it by the end of this month, although that may have changed.

If you want to embed a web browser which supports modern sites, you'll need to use something else. For example, CefSharp[^] or WebView[^].
 
Share this answer
 
That's a text box. you need a web browser control
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900