日期:2014-05-19  浏览次数:21316 次

郁闷实在受不了了,老是“CS1513: } expected”
代码如下:

在aspx页面中写的

if(   Application[ "var "]   ==   " "   )
{
Response.Redirect( "Default.aspx?bid=yes ")   ;

Application[ "var "]     =   "3 "   ;

}

string   bid   =   Request.QueryString[ "bid "]   ;  


public   string   vart   ()
{

}

Compiler   Error   Message:   CS1513:   }   expected

Source   Error:

 

Line   25:   }
Line   26:  
Line   27:   string   bid   =   Request.QueryString[ "bid "]   ;  
Line   28:  
Line   29:  
 


------解决方案--------------------
完整代码?

是不是差个 }

*****************************************************************************
欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码)

http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html
------解决方案--------------------
string bid = (Request.QueryString[ "bid "]==null?String.Empty:Request.QueryString[ "bid "].Tostring()) ;
------解决方案--------------------
贴出完整代码出来看看....
------解决方案--------------------
你是不是从asp拷过来的呀,在 ASP.NET 中,页函数必须在 <script runat=server> 块中声明

<script language= "C# " runat=server>

void dosomething() {
if( Application[ "var "] == " " )
{
Response.Redirect( "Default.aspx?bid=yes ") ;

Application[ "var "] = "3 " ;

}

string bid = Request.QueryString[ "bid "] ;

}

</script>



------解决方案--------------------
大哥,这段得有个 Page_Load 套着啊
private void Page_Load(object sender, EventArgs e)
{
if( Application[ "var "] == " " )
{
Response.Redirect( "Default.aspx?bid=yes ") ;

Application[ "var "] = "3 " ;
}

string bid = Request.QueryString[ "bid "] ;
}