Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在InternetExplorer8中使用javascript代码_C#_Asp.net - Fatal编程技术网

C# 在InternetExplorer8中使用javascript代码

C# 在InternetExplorer8中使用javascript代码,c#,asp.net,C#,Asp.net,在所有主要的现代浏览器中,我都可以执行以下操作: protected void Page_Load(object sender, EventArgs e) { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), Guid.NewGuid().ToString(), "alert('Show on pageload')", true); } 当我打开页面时,会出现一个Javascript弹出窗口,上面写着“在页面加载时显示”

在所有主要的现代浏览器中,我都可以执行以下操作:

protected void Page_Load(object sender, EventArgs e)
{
    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), Guid.NewGuid().ToString(), "alert('Show on pageload')", true);
}
当我打开页面时,会出现一个Javascript弹出窗口,上面写着“在页面加载时显示”


在Internet Explorer 8中,不会出现弹出窗口。我该怎么做才能使Javascript在IE 8中工作?

基本上,IE 8中的
警报
功能应该没有问题


在IE浏览器中->右键单击->选择查看源代码并查看实际生成的脚本。

基本上,IE 8中的
警报
功能应该没有问题


在IE浏览器中->右键单击->选择“查看源代码”并查看实际生成的脚本。

您是否看到任何脚本错误?我没有看到任何脚本错误。您是否在多台使用IE8的计算机上尝试过此操作?可能是javascript被禁用,或者在您正在测试的计算机上出现了类似的情况。您是否看到任何脚本错误?我没有看到任何脚本错误。您是否在多台使用IE8的计算机上尝试过此操作?可能是javascript被禁用,或者在您正在测试的计算机上出现了类似的情况。您是对的,代码正在生成,但不会启动。您是对的,代码正在生成,但不会启动。