Asp.net源码专业站
首页->尚未分类->BugTrack免安装英文原版2.4.8>>ajax2.aspx>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:BugTrack免安装英文原版2.4.8
当前文件:文件类型 XTXHGRGZAXU57/ajax2.aspx[1K,2009-6-12 12:00:16]打开代码结构图
普通视图
		            
1<%@ Page language="C#"%> 2<!-- #include file = "inc.aspx" --> 3 4<script runat="server"> 5 6DbUtil dbutil; 7Security security; 8 9/////////////////////////////////////////////////////////////////////// 10void Page_Load(Object sender, EventArgs e) 11{ 12 13 Util.do_not_cache(Response); 14 dbutil = new DbUtil(); 15 security = new Security(); 16 security.check_security(dbutil, HttpContext.Current, Security.ANY_USER_OK); 17 18 // will this be too slow? 19 20 // we could index on bg_short_desc and then do '$str%' rather than '%$str%' 21 22 try 23 { 24 string sql = @"select distinct top 10 bg_short_desc from bugs 25 where bg_short_desc like '%$str%' 26 order by 1"; 27 28 // if you don't use permissions, comment out this line for speed? 29 sql = Util.alter_sql_per_project_permissions(sql, security.this_usid); 30 31 string text = Request["q"]; 32 sql = sql.Replace("$str",text.Replace("'","''")); 33 34 DataSet ds = dbutil.get_dataset(sql); 35 36 37 if (ds.Tables[0].Rows.Count > 0) 38 { 39 Response.Write ("<select id='suggest_select' class='suggest_select' size=6 "); 40 Response.Write (" onclick='select_suggestion(this)' onkeydown='return suggest_sel_onkeydown(this, event)'>"); 41 foreach (DataRow dr in ds.Tables[0].Rows) 42 { 43 Response.Write("<option>"); 44 Response.Write(dr[0]); 45 Response.Write("</option>"); 46 } 47 Response.Write("</select>"); 48 } 49 else 50 { 51 Response.Write(""); 52 } 53 } 54 catch(Exception) 55 { 56 Response.Write(""); 57 } 58} 59 60 61</script> 62 63
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:BugTrack免安装英文原版2.4.8
51Aspx.com 版权所有 CopyRight © 2006-2010. 京ICP备06046876号 本站法律顾问:ITlaw-庄毅雄律师
返回顶部
客户服务:点击这里进行客户咨询 业务合作:点击这里洽谈业务合作 合作热线:010-68880146