简体   繁体   中英

Scripts are not working in web browser control

I used web browser control to load google maps in my .net app. here is the code..

string keyword = "colombo";
    private void Form1_Load(object sender, EventArgs e)
    {
        StringBuilder query = new StringBuilder();
        query.Append("http://maps.google.com/maps?q=");
        try
        {
            query.Append(keyword);

            Browser.Navigate(query.ToString());
        }
        catch (Exception)
        {                
            throw;
        }
    }

but after loading the result page for the given keyword (here "colombo") even if I click buttons in the page it doesn't work. what am I missing...?

string keyword = "colombo";
private void Form1_Load(object sender, EventArgs e)
{
    String query = "";
    query="http://maps.google.com/maps?q=";
    try
    {
        query+=keyword;

        Browser.Navigate(query);
    }
    catch (Exception)
    {                
        throw;
    }
}

try this one without StringBuilders...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM