“未将对象引用设置到对象的实例。”
报这个错是因为Request.QueryString["BookID"]不存在,
string BookID= "";if (Request.QueryString["BookID"] != null)
{
BookID= Request.QueryString["BookID"].ToString();}
这样写就可以了
报这个错是因为Request.QueryString["BookID"]不存在,
string BookID= "";if (Request.QueryString["BookID"] != null)
{
BookID= Request.QueryString["BookID"].ToString();}
这样写就可以了
===============================================
传值的语句?获取索引时报“索引超出范围。必须为非负值并小于集合大小。参数名: index”
hoppingCars sc = (ShoppingCars)this.dlShopCart.DataKeys[e.Item.ItemIndex];
================================================
没有设置DataList的DataKeyField属性
{
ID = Request.QueryString["BookID"].ToString();
}
else
{ ID = Request.QueryString["VoiceID"].ToString();
}
就是这句话报错
if(Request.QueryString["BookID"] == null && Request.QueryString["VoiceID"] == null)
运行ID = Request.QueryString["VoiceID"].ToString();就错了
“未将对象引用设置到对象的实例。”