<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="gb2312" %>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>text</title>
</head>
<body>
<form runat="server" >
<p>
姓名
<asp:TextBox ID="named" runat="server" BorderWidth="1" />
</p>
<p>电话
<asp:TextBox ID="xingqu" runat="server" BorderWidth="1" /></p>
<p><asp:Button runat="server" Text="提交" OnClick="button_click"/></p>
</form>
</body>
</html>
<script language="vb" runat="server">
sub button_click(sender as object,e as eventargs)
dim url,cityurl,i
url="test1.aspx?named="& server.HtmlEncode(named.text)
url &= "&xingqu=" & server.HtmlEncode(xingqu.text)
server.Transfer(url)
end sub
</script>
然后我在test1.aspx中用了以下代码接受.
<% dim a,b
a=request("named")
b=request("xingqu")
response.Write(a & "你的兴趣是" & b)
%>
如果输入的英文,比如在named文本框输入"john",在xingqu文本框输入"football",则在test1.aspx就会显示"john你的兴趣是football"
但如果我在在named文本框输入"王五",在xingqu文本框输入"足球".则在test1.aspx中不能显示出中文变量.只显示" 你的兴趣是 "
中间空了格的就是没显示出来的.
请问怎么解决呢