有这样一段程序:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>标题页</title>
</head>
<body>
<form Name="InputForm">
<div align="center"><center><p>
<script language="JavaScript">
var FirstForm;
function StartSearch()
{
//使用隐藏控件保存用户输入的查询参数
document.forms[FirstForm+document.InputForm.SearchSelect.
selectedIndex].elements[0].value=document.InputForm.SearchWords.value;
//提交查询参数到指定网站
document.forms[FirstForm+document.InputForm.SearchSelect.selectedIndex].submit();
}
</script>
<span style="font-size: 9pt">查找内容:</span>
<input name="SearchWords" type="text" size="21" style=" margin-left: 1px"><br>
<span style="font-size: 9pt">搜索引擎:</span>
<select Name="SearchSelect" size="1" >
<option selected>英文Yahoo</option>
<option value="Google搜索">中文Google</option>
<option value="百度搜索">百度中文搜索</option>
</select><br>
<input type="button" value=" 开始查找 " onClick="StartSearch()">
<script language="JavaScript">
FirstForm=document.forms.length
</script></p>
</center></div>
</form>
<form action="http://search.yahoo.com/bin/search" method="get">
<input type="hidden" name="p" value>
</form>
<form action="http://www.google.com/search">
<input type="hidden" name="q" value>
</form>
<form action="http://www.baidu.com/s">
<input type="hidden" name="wd" value>
</form>
</body>
</html>
原来运行的很好,当在vs2005中新增htm页面后,把这段程序拷进去,运行时中文百度搜索时结果出现乱码;
当新增aspx页面后,把这段程序拷进去,运行没有反应,提示网页上有错误。
我想是否版本问题,原来的程序版本低了,怎么转换呢?
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>标题页</title>
</head>
<body>
<form Name="InputForm">
<div align="center"><center><p>
<script language="JavaScript">
var FirstForm;
function StartSearch()
{
//使用隐藏控件保存用户输入的查询参数
document.forms[FirstForm+document.InputForm.SearchSelect.
selectedIndex].elements[0].value=document.InputForm.SearchWords.value;
//提交查询参数到指定网站
document.forms[FirstForm+document.InputForm.SearchSelect.selectedIndex].submit();
}
</script>
<span style="font-size: 9pt">查找内容:</span>
<input name="SearchWords" type="text" size="21" style=" margin-left: 1px"><br>
<span style="font-size: 9pt">搜索引擎:</span>
<select Name="SearchSelect" size="1" >
<option selected>英文Yahoo</option>
<option value="Google搜索">中文Google</option>
<option value="百度搜索">百度中文搜索</option>
</select><br>
<input type="button" value=" 开始查找 " onClick="StartSearch()">
<script language="JavaScript">
FirstForm=document.forms.length
</script></p>
</center></div>
</form>
<form action="http://search.yahoo.com/bin/search" method="get">
<input type="hidden" name="p" value>
</form>
<form action="http://www.google.com/search">
<input type="hidden" name="q" value>
</form>
<form action="http://www.baidu.com/s">
<input type="hidden" name="wd" value>
</form>
</body>
</html>
原来运行的很好,当在vs2005中新增htm页面后,把这段程序拷进去,运行时中文百度搜索时结果出现乱码;
当新增aspx页面后,把这段程序拷进去,运行没有反应,提示网页上有错误。
我想是否版本问题,原来的程序版本低了,怎么转换呢?
解决方案 »
- 求助:.net DataList绑定了ObjectDataSource后如何分页
- 看到的帮忙看下 在线等
- js 动态添加控件
- 网站抓取问题
- sql安装闹鬼
- 简单问题:Application_Error
- 将做好的网站改变服务器后为什么有这样的错误?
- 加密后解密,乱码问题!!!!100分,不够在给!!
- 问一个三层结构的问题
- 简单问题,asp.net中sqlcommand执行sql的结果返回的参数如何接收?
- 自定义的控件,里面只有一个服务器端的Table,手动添加button,单击时不响应command事件
- SqlDataSource1.SelectCommand = "select * from address where code=@a"; 如何添加这个参数
在web.config中增加:
<globalization fileEncoding="gb2312" requestEncoding="gb2312" responseEncoding="gb2312" culture="zh-CN" uiCulture="zh-CN"/>另外aspx文件必须放到iis虚拟目录中才能执行。请确认你的测试环境是否正常,在我的机器上两种方式都测试通过。
另外,我在iis建的是网站,在默认网站下。