随笔分类 - ASP.Net+C#
写关于ASP.Net+C#方面的文章
摘要:Asp.Net中在客户端判断checkboxlist是否选择方法之一: Asp.Net中在客户端判断checkboxlist是否选择方法之二:for(i=0;i<10;i++){if(eval("document.getElementById(SubJect_"+i+")").checked==true){ return true;}}
阅读全文
摘要:^[\u4e00-\u9fa5]{1,20}$ 这个是 验证中文的正则表达式 System.Text.Encoding.Default.GetByteCount( strString );--返回字节数 //判断字符串是否是数字 string str1=this.textBox1.Text.Trim(); if(Regex.IsMatch(str1,@"^\d+$")) { MessageBox...
阅读全文
摘要:提交查询时,报错显示"从客户端检测到有潜在危险的Request.Form 值"(.Net Framework1.1)的解决方案:1、web.config文件后面加入这一句: 示例: 2、在*.aspx文件头的Page中加入validateRequest="false",示例如下:
阅读全文
摘要:一:header.asc 二:header.asc.csnamespace s2p.Application.Teacher.Controls{ using System; using System.Data; using System.Drawing; using System.Web; using System.Web.UI; using System.Web.UI...
阅读全文
摘要:/// /// 设置DataGrid的pager格式 /// /// 需要处理的DataGrid /// DataGride的ItemCreated事件参数 public static void DataGridPageSet(DataGrid dgMain, System.Web.UI.WebControls.DataGridItemEventArgs e) { if(e...
阅读全文
摘要:一、常量定义问题public static string IsScorePubSMSedSchoolID="*****"; public static string IsScorePubSMSedCity="***";二、获得两个时间之间的周数 public int DateDiffWeek(DateTime StartTime,DateTime EndTime){ System.Globa...
阅读全文
摘要:/// /// 获得时间建立的语音文件名的时间部分 /// /// public string GetFileName(){ string NowDateFileName=""; DateTime dt=DateTime.Now; NowDateFileName=dt.Year.ToString(); if(dt.Month.ToString().Length==1...
阅读全文
摘要:/// /// 执行多条SQL语句,事务处理 /// /// 以";"相隔的查询语句 public bool InsertMoreDB(string strSQL){ char[] de={';'}; string strChildSQL; int i; string[] strSQLArr=strSQL.Split(de); bool IsControll=t...
阅读全文
摘要:/// /// 返回一个单独值 /// /// 查询语句 /// SQL语句结果,单值。 public string GetDBValue_ex(string strSQL) { string ret=""; SqlConnection oConn=DBCreateCN(); SqlCommand oCmd=new SqlCommand(strSQL,oConn);...
阅读全文
摘要:一、基类源代码using System;using System.Web.SessionState; namespace s2p.Application.Teacher{ /// /// 用于测试的自动赋予session的页面基类 /// public class BasePage:System.Web.UI.Page { public BasePage() { // // TOD...
阅读全文
摘要:一、aspx的部分代码; ...
阅读全文
摘要:在事件ItemDataBound中进行灵活控制。此事件在数据绑定后执行。 private void Datagrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { if(e.Item.ItemIndex>=0){ e.Item.Cells[7].Text=Unit.P...
阅读全文
摘要:先发上来,以后再整理,这是我在最近工作中解决的问题。如果那为朋友有更好的方法,请发给我一下,小弟感谢。一、动态创建列函数 private void DatagridDataBaind(){ int i; string strTempValue; DataTable dtcom = (DataTable)Session["Source"]; DataTable dtsub=(Dat...
阅读全文
摘要:今天在工作做到处数据为Excel时,在用到DataGrid时,要求表头为两行 ,以前没用过,把我难到了,又不想用用客户端的Table,觉得可读性太差,研究了一会,终于找到了解决方法,先发上来,由于时间关系,就不整理了。呵呵。private void Datagrid1_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItem...
阅读全文
摘要:今天我在工作中利用Teechart生成 成绩分析图,源代码主要片段先发上来。不好意思。没时间整理,大家自己看。我是菜鸟(^ - ^) WebChart wc=new WebChart(); wc.Visible=true; Steema.TeeChart.Chart ch2=wc.Chart; MemoryStream tmpChart2=new Memory...
阅读全文

浙公网安备 33010602011771号