Attributes.add
摘要:我现在想在文本框获得焦点的时候去触发一个事件.可是ASP.NET里文本框没有焦点事件. 假设当TEXT1获得焦点的时候.让Lable1的背景色改变。如何实现? 在后台代码里if(!Page.IsPostBack){ txt_Test.Attribute.Add("onfocus","return text1_onfocus()")} 这样写:Me.TextBox1.Attrib...
阅读全文
关于MagicAjax的用法
摘要:最近,用了一下MagicAjax 觉得不错,使用很简单,经验终结如下: 1、打开vs 添加 MagicAjax.dll,就会有AjaxPanel 控件,就往上拖东西吧。(简单吧!) 2、打开web.config 添加: ... ...
阅读全文
Asp.net 2.0 使用FormView + ObjectDataSource 或 SqlDataSource 插入记录后 定位到被插入行
摘要:文件下载地址包含sql2k5的mdf 请自行附加:http://www.cnblogs.com/Files/iCaca/SqlOutputParameter.rarcreatetable 是sql2k5的语法 2k可能会报错 请自行修改 Tabel UserCode highlighting produced by Actipro CodeHighlighter (freeware)http://...
阅读全文
ASP.NET页面之间传递值个人总结
摘要:ASP.NET页面之间传递值个人总结 方式1: 在接收页 的html代码里加上一行: WebForm1 fp=(WebForm1)Context.Handler; this.TextBox1.Text=fp.name; //name 是第一页的public变量 Context 提供对整个当前上下文(包括请求对象)的访问。...
阅读全文
使用 IIS 进行 Microsoft ASP.NET 2.0 成员/角色管理,第 2 部分:实现
摘要:使用 IIS 进行 Microsoft ASP.NET 2.0 成员/角色管理,第 2 部分:实现 发布日期: 2006-2-10 | 更新日期: 2006-2-10 Peter Kellnerhttp://peterkellner.net/ 适用于:Microsoft ASP.NET 2.0Microsoft Visual Studio 2005Microsoft Internet 信息服务...
阅读全文
计算时间绝对值
摘要:Math.Abs(DateDiff(DateInterval.Day, Me.DateTimePicker1.Value, Me.DateTimePicker2.Value))
阅读全文
按扭样式
摘要:1常用CSS 2/**//**//**//*按钮样式*/ 3.ButtonCss {}{ 4 font-family: "Tahoma", "宋体"; 5 font-size:9pt; color: #003399; 6 border: 1px #003399 solid; 7 color:006699; 8 BORDER-BOTTOM: #93b...
阅读全文
向GridView手动添加Table.
摘要:DataTable dt = new DataTable(); dt.Columns.Add("条件类型"); dt.Columns.Add("类型"); dt.Columns.Add("条件"); dt.Columns.Add("范围"); DataRow dr = dt.NewRow(); dr["条件类型"]...
阅读全文
c#.net常用字符的处理
摘要:汇总c#.net常用函数和方法集 1、DateTime 数字型 System.DateTime currentTime=new System.DateTime(); 1.1 取当前年月日时分秒 currentTime=System.DateTime.Now; 1.2 取当前年 int 年=currentTime.Year; 1.3 取当前月 int 月=currentTime.Month; 1.4...
阅读全文
DataGrid模版中嵌入了dropdownlist,如何触发这个dropdownlist的事件
摘要:protected void ddlChange(object sender, System.EventArgs e){TextBox1.Text = "111";} private void DataGrid1_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e){if(e.Item.ItemT...
阅读全文
GridView不能编辑更新或删除问题之一
摘要:设置问题:GridView1.DataKeyNames 设置为主键 KEY
阅读全文