cid = (string.IsNullOrEmpty(typeId) ? null : ( Convert.ToInt32( typeId)) ) 有

cid (string.IsNullOrEmpty(typeId) ?null : ( Convert.ToInt32( typeId)) )有@{var typeId Request.Q

cid = (string.IsNullOrEmpty(typeId) ? null : ( Convert.ToInt32( typeId)) ) 有


        @{var typeId = Request.QueryString["cid"];
          int? cid;
         cid = (string.IsNullOrEmpty(typeId) ?  null : ( Convert.ToInt32( typeId)) );
}


( Convert.ToInt32( typeId)) )   这一块下边出现红线,显示有错,该怎么写

因为有个函数里边有个 类型就是 int ?,所以我进行上边转换
[解决办法]
try

 cid = string.IsNullOrEmpty(typeId) ?  null : (int?) Convert.ToInt32( typeId);