创建了一个weather.aspx,内容如下:<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="weather.aspx.cs" Inherits="WebApplication.weather" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>
<head>
<script src="res://mshtml.dll/objectembed_neutral.js"></script>
</head>
<body objectSource="http://flash.weather.com.cn/wmaps/index.swf" onload="ObjectLoad();" leftmargin=0 topmargin=0 scroll=no>
<form id="objectDestination"></form>
</body>
</html>此页面在IE7下可以正常浏览。接下来创建一个Winform,使用WebBrowser控件打开weather.aspx页面,结果报JS错误:调试发现找不到ObjectLoad()函数(该函数在res://mshtml.dll/objectembed_neutral.js中)。
将weather.aspx页面的代码放到静态页面test.html里,可以正常浏览,再使用WebBrowser控件打开test.html页面也可以正常浏览。现在就困惑了,WebBrowser打开动态页面怎么就加载不了“res://mshtml.dll/objectembed_neutral.js”,有人遇到过类似情况吗?期待高人指点!非常感谢!
<head>
<script src="res://mshtml.dll/objectembed_neutral.js"></script>
</head>
<body objectSource="http://flash.weather.com.cn/wmaps/index.swf" onload="ObjectLoad();" leftmargin=0 topmargin=0 scroll=no>
<form id="objectDestination"></form>
</body>
</html>此页面在IE7下可以正常浏览。接下来创建一个Winform,使用WebBrowser控件打开weather.aspx页面,结果报JS错误:调试发现找不到ObjectLoad()函数(该函数在res://mshtml.dll/objectembed_neutral.js中)。
将weather.aspx页面的代码放到静态页面test.html里,可以正常浏览,再使用WebBrowser控件打开test.html页面也可以正常浏览。现在就困惑了,WebBrowser打开动态页面怎么就加载不了“res://mshtml.dll/objectembed_neutral.js”,有人遇到过类似情况吗?期待高人指点!非常感谢!
解决方案 »
- 100分 使用System.Diagnostics.Process.Start()怎么在不关闭IE的情况下打开新的网址?
- 关于GetDataTable的问题
- 一个很简单的问题。
- C#Winform让打开的窗体不重复(没事干,发个老掉牙的问题)
- Linq奇怪问题
- C#2005连接数据库问题
- 请教一个关于repeater中使用用户控件时,时序的问题,在线等待,谢谢!
- 急急急急急急急急急急急急急急急急急急急!!在线等!!快要下岗了
- 一个复杂的问题,高手进
- C#打印问题如何打印公文形式的文档并输出为word
- 获取CheckedListBox的值
- 紧急求救!C#调用COM组件报HRESULT E_FAIL。未使用IIS
解决方法:添加信任站点
{
try
{
this.About_webBrowser_Map.Url = new Uri(ConfigurationManager.AppSettings["ctmmap"]);
this.About_webBrowser_Map.ScriptErrorsSuppressed = false;
}
catch
{
}
}