摘要:// 递归添加版块分类 privatevoidBindTreeCa() { //每次加载前先清空 litTree.Text=""; //从数据库中获取分类数据集 DataSetds=newDAL.CategoryDAO().GetList(""); if (ds.Tables.Count>0) { //Linq先加载顶级分类 varquery1=ds.Tables[0].AsEnumerable().Where(x=>x["pid"].ToString() =="0"); //循环添加 foreach
阅读全文
摘要:注:使用前应先引入jQuery包<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text
阅读全文
摘要:有些时候为了快捷,点击一个连接或是按钮时候要跳到本页面的其他地方,需要设置锚点步骤一.在需要快捷地方加入<a href="#re">回复</a>步骤二.在目的地附近加入<a id="re"></a>
阅读全文
摘要:用户自定义事件中: string content = txtcontent.Text.Trim(); string title = txttitle.Text.Trim(); if (Session["User"] == null) { //还没登录转向登录页进行登录 Response.Cookies["content"].Value = content; Response.Cookies["title"].Value = title; //编码后才不会被抹掉 string url = Server.UrlEncode(Request
阅读全文
摘要:步骤一.在全局函数Application_Start中加入:if (Application["Online"] ==null) { List<string>list=newList<string>(); Application["Online"] =list; }步骤二、然后在用户登录后加入:List<string>list=Application["Online"] asList<string>; //将登陆的用户名存入Application["Online"]中
阅读全文
摘要:protected void Page_Load(object sender, EventArgs e) { this.CreateCode(this.CreateStr()); Session["check_code"] = CreateStr(); } protected string CreateStr() { string str = ""; Random random = new Random(); str = random.Next(1000,9999).ToString(); return str; } protected void Cre
阅读全文
摘要:步骤一.将下面的js代码拷贝到所要显示的地方并设置好图片显示的高度和宽度:<scriptlanguage="javascript"> linkarr=newArray(); picarr=newArray(); textarr=newArray(); varfocus_width=395; // 图片的宽度 varfocus_height=250; // 图片的高度 vartext_height=0; // 底部文字的高度 varpics=""; varlinks=""; vartexts=""; va
阅读全文
摘要:select COUNT(1) ,DATENAME(year ,createdate) as Year,DATENAME(month,createdate) as Month,Datename(day, createdate) as Day from bbs_topic group by Datename(day, createdate),Datename(month, createdate),Datename(year, createdate)
阅读全文