Crdown's学习笔记

ASP.NET,Report...

博客园 首页 新随笔 联系 订阅 管理

 

昨天经高手指导

 

测试使用了

==?: 和 if()else()

 

xzyHe 为 DropDownlist 值,如果为空取值为0

if (xzyHe =="")

{

int xzyHe==0;



else

{

int xzyHe = DropDownlist.Text.Trim();

}

 

另外一种写法:

 


 

int xzyHe = ConVert.ToInt32(xzyHe == ""?0:int.Parse(DropDownlist.Text.Trim()));

 

posted on 2010-03-12 09:49  Crdown  阅读(350)  评论(0编辑  收藏  举报