2012年7月31日

递归加载无限级分类,虽然我觉得效率不太好。

摘要: // 递归添加版块分类 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 阅读全文

posted @ 2012-07-31 20:12 yxfaction 阅读(224) 评论(0) 推荐(0) 编辑

鼠标移到某一元素则在某一元素出现弹出框

摘要: 注:使用前应先引入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 阅读全文

posted @ 2012-07-31 17:40 yxfaction 阅读(535) 评论(0) 推荐(0) 编辑

2012年7月30日

如何在ASP.NET中设置锚点

摘要: 有些时候为了快捷,点击一个连接或是按钮时候要跳到本页面的其他地方,需要设置锚点步骤一.在需要快捷地方加入<a href="#re">回复</a>步骤二.在目的地附近加入<a id="re"></a> 阅读全文

posted @ 2012-07-30 21:01 yxfaction 阅读(805) 评论(1) 推荐(1) 编辑

2012年7月29日

页面回调时参数保存原样,并且可以讲保存先前用户的输入的值

摘要: 用户自定义事件中: 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 阅读全文

posted @ 2012-07-29 15:30 yxfaction 阅读(238) 评论(0) 推荐(0) 编辑

在线用户的简单的统计和显示(只是一种很局限的在线用户统计显示,先留着,以后再研究复杂的)

摘要: 步骤一.在全局函数Application_Start中加入:if (Application["Online"] ==null) { List<string>list=newList<string>(); Application["Online"] =list; }步骤二、然后在用户登录后加入:List<string>list=Application["Online"] asList<string>; //将登陆的用户名存入Application["Online"]中 阅读全文

posted @ 2012-07-29 10:36 yxfaction 阅读(146) 评论(0) 推荐(0) 编辑

2012年7月28日

ASP.NET中一个简单的验证码生成程序,留着以后用!

摘要: 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 阅读全文

posted @ 2012-07-28 20:14 yxfaction 阅读(136) 评论(0) 推荐(0) 编辑

2012年7月27日

实现图片轮播效果

摘要: 步骤一.将下面的js代码拷贝到所要显示的地方并设置好图片显示的高度和宽度:<scriptlanguage="javascript"> linkarr=newArray(); picarr=newArray(); textarr=newArray(); varfocus_width=395; // 图片的宽度 varfocus_height=250; // 图片的高度 vartext_height=0; // 底部文字的高度 varpics=""; varlinks=""; vartexts=""; va 阅读全文

posted @ 2012-07-27 18:32 yxfaction 阅读(1019) 评论(0) 推荐(0) 编辑

SQL获取当天的记录数按年月日降序

摘要: 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) 阅读全文

posted @ 2012-07-27 18:10 yxfaction 阅读(488) 评论(0) 推荐(0) 编辑

导航