日期:2014-05-18  浏览次数:20407 次

大家好;我是新来的,刚接触ASP.net 有个问题向老师们请教!
我看的教程是《亲密接触ASP.NET》
里边有这样一个例子是讲request方法的,说用querystring集合;
例子:
请求页面(aaa.html)的代码如下:
<html>
<head>
<title>
发送GET请求 </title>
</head>
<body>
<center>
<hr>
<form   action= "aa.aspx "   method   = "get ">
        your   big   name:
        <input   type= "text "   name= "nickname ">   <br>
        <input   type= "submit "   value= "send ">
       
</form>
</center>
</body>
</html>  
得到页面(aa.aspx)的代码:
<%@   Page   Language= "c# "   %>
   
</script>
<html>
<head> <title> get   request </title> </head>
<body>
<center> 接收GET方法传来的值
<hr>

<%  
        string   NickName;
       
        NickName   =   Request.GetType( "nickname ");

        Response.Write( "Get   method   pass   value   is "   +   NickName);
%>

</center>
</body>
</html>

执行出来的结果是错误的!错误信息如下!
×××××××××××××××××××××××××××××
“/”应用程序中的服务器错误。
--------------------------------------------

编译错误  
说明:   在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。  

编译器错误信息:   CS0118:   “System.Web.HttpRequest.QueryString”是“属性”,但此处被当做“方法”来使用

源错误:

 

行   11:           string   NickName;
行   12:          
行   13:           NickName   =   Request.QueryString( "nickname ");
行   14:  
行   15:           Response.Write( "Get   method   pass   value   is "   +   NickName);
 

源文件:   d:\我的文档\postboard\aa.aspx         行:   13  


Microsoft   (R)   Visual   C#   2005   编译器   版本   8.00.50727.42
用于   Microsoft   (R)   Windows   (R)   2005   Framework   版本   2.0.50727
版权所有   (C)   Microsoft   Corporation   2001-2005。保留所有权利。

d:\我的文档\postboard\aa.aspx(13,24):   error   CS0118:   “System.Web.HttpRequest.QueryString”是“属性”,但此处被当做“方法”来使用

 
--------------------------------------------
版本信息:   Microsoft   .NET   Framework   版本:2.0.50727.42;   ASP.NET   版本:2.0.50727.42  
×××××××××××××××××××××××××××××××
可我把代码改成:
<%@   Page   Language= "vb "   %>
   
</script>
<html>
<head> <title> get   request </title> </head>
<body>
<center> 接收GET方法传来的值
<hr>

<%  
dim   NickName    
        NickName   =   Request.GetType( "nickname ")  

        Response.Write( "Ge