62,025
社区成员
发帖
与我相关
我的任务
分享
public void GetType(...)
{
List<TypeInfo> typeList = (List<TypeInfo>)session["tpList"];
if(这里判断typeList是否存在)
{
typeList = new List<TypeInfo>();//如果不存在就NEW一个
}
TypeInfo type = new TypeInfo();
type.typeID=convert.toint32(textbox.text);
type.typeName = textbox.Text;
typeList.add(type);
session["tpList"] = typeList;
}
public GetsessionType()
{
List<TypeInfo> type = (List<TypeInfo>)session["tpList"];
dataList1.datasourt=type;
dataList1.dataBind();
}