字典类的子集
using System.Collections.Generic;
DictionarydicB = new Dictionary () { { "B1","○"},{ "B2","○"},{ "B3","○"},{ "B4","○"},{ "B5","○"}, { "B6","○"},{ "B7","○"},{ "B8","○"},{ "B9","○"},{ "B10","○"} };
当使用字典类时,循环
foreach (KeyValuePairitem in dicB) { wth.UseBookmark(doc, item.Key, item.Value); }
网页中的锚定
可以快速定位到某一个元素。
回话 //点击这个就可以定位到ID位Label1这个元素 格式为 href='#ID'
如果不是a标签怎么定位,我们做点击事件
$("#Label2").click(function () { location.href = "#Label1"; //一个道理 });
如果在一般处理程序中使用到了Session,需要继承 IRequiresSessionState
必须先引用
取此条数据的上一条数据和下一条数据
//先把数据全部取出来,用Lis来保存
ListlistInfo = new BLL.Boda_Information().GetModelList( " ReleaseUser='" + infoModel.ReleaseUser + "' and InfoType=" + infoModel.InfoType + " order by ReleaseTime desc "); Model.Boda_Information firtModel = null; if (listInfo.Any(x => x.ID < infoModel.ID)) //需要做判断 存不存在比这条数据小的ID { firtModel = listInfo.Where(x => x.ID < infoModel.ID).OrderByDescending(x => x.ID).First(); //上一篇 倒序排 } Model.Boda_Information nextModel = null; if (listInfo.Any(x => x.ID > infoModel.ID)) { nextModel = listInfo.Where(x => x.ID > infoModel.ID).OrderBy(x => x.ID).First();//下一篇 正序排 }