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 ?,所以我进行上边转换 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 try cid = string.IsNullOrEmpty(typeId) ? null : (int?) Convert.ToInt32( typeId); 谢谢,我去试试我现在写成 @{var typeId = Request.QueryString["cid"]; int? cid; if (string.IsNullOrEmpty(typeId)) {cid = null;} else {cid = Convert.ToInt32(typeId);} } 去掉多余的using 引用,能否提高性能 IIS虚拟目录为另外一台服务器的共享文件的问题 可以在style里加服务器标记<%%>么? asp.net 获得系统时间有错 利用ISAPI_Rewrite做二级域名 ExecuteScalar 要求已打开且可用的连接。连接的当前状态为已关闭。 如何在ie最下端的提示栏中显示提示信息? vs.net2005与sql2005开发的网络项目可以在sql2000下运行吗? 为什么浏览aspx文件会出现以下错误 如何监听客户端页面的键盘和鼠标事件? dropdownlist 页面刷新,保持上次的选项 Treeview 控件使用问题
谢谢,我去试试我现在写成
@{var typeId = Request.QueryString["cid"];
int? cid;
if (string.IsNullOrEmpty(typeId))
{cid = null;}
else
{cid = Convert.ToInt32(typeId);}
}