悟生慧

 
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 27 下一页

2011年4月18日

winfrom定制窗体样式

摘要: public class WinformStyle { #region 定制窗体样式 /// <summary> /// 定制窗体(Lable{背景:天蓝色},TextBox{文本为空},ComboBox{文本不可编辑},DateTimePicker{大小:190,31}) /// </summary> /// <param name="parentControl">父级容器</param> /// <param name="frmFont">字体大小</param> public 阅读全文

posted @ 2011-04-18 11:37 悟生慧 阅读(1401) 评论(0) 推荐(0)

Winform TextBox中只能输入数字的几种常用方法(C#)

摘要: 方法一:private void tBox_KeyPress(object sender, KeyPressEventArgs e){ if (e.KeyChar == 0x20) e.KeyChar = (char)0; //禁止空格键 if ((e.KeyChar == 0x2D) && (((TextBox)sender).Text.Length == 0)) return; //处理负数 if (e.KeyChar > 0x20) { try { double.Parse(((TextBox)sender).Text + e.KeyChar.ToString()) 阅读全文

posted @ 2011-04-18 11:24 悟生慧 阅读(3448) 评论(0) 推荐(2)

2011年4月14日

ASP.NET不允许输入空格

摘要: 方法一:<script type="text/javascript"> function isNull() { if (window.event.keyCode==32) { return false; } } </script>if(string.IsNullOrEmpty(TextBox1.text.Trim())){}方法三:if (document.getElementById("txt_1").value.indexOf(' ') != -1) { alert('已包含空格符'); } & 阅读全文

posted @ 2011-04-14 17:50 悟生慧 阅读(598) 评论(0) 推荐(0)

GridView中使用LinkButton添加启用禁用功能

摘要: 菜鸟学习前台<asp:LinkButton ID="lkBtnStart" runat="server" CommandArgument='<%# Eval("es_status") +"&"+ Eval("es_No") %>' ForeColor="Red" Text='<%# Eval("es_status") %>' CommandName="UpStart" 阅读全文

posted @ 2011-04-14 10:59 悟生慧 阅读(1617) 评论(0) 推荐(0)

合并GridView的标头

摘要: /// <summary> /// 合并操作标头 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void gvData_RowCreated(object sender, GridViewRowEventArgs e) { switch (e.Row.RowType) { case DataControlRowType.Header: TableCellC 阅读全文

posted @ 2011-04-14 10:03 悟生慧 阅读(342) 评论(0) 推荐(0)

2011年4月13日

GridView中点击删除弹出JS提示信息

摘要: 方法一:protected void gvData_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { LinkButton lbtnDelete = (LinkButton)e.Row.FindControl("ibtnDelete"); lbtnDelete.Attributes.Add("onclick", "return confirm('确认要删除此门店信息吗?' 阅读全文

posted @ 2011-04-13 15:06 悟生慧 阅读(681) 评论(0) 推荐(0)

js 调用C#.NET后台方法 转载自:http://www.cnblogs.com/lizhao/archive/2010/11/23/1990436.html

摘要: 第一种:<script type="text/javascript">$(document).ready(function() {sshow();});function sshow(){ var s = '<%=IsShow() %>'; if(s == '0') { document.getElementById("trr").style.display= "none"; }else { document.getElementById("trr").styl 阅读全文

posted @ 2011-04-13 14:31 悟生慧 阅读(597) 评论(0) 推荐(0)

2011年4月12日

.NET 正则验证邮箱

摘要: ///.NET 正则验证邮箱public bool IsValidEmail(string strIn) { // Return true if strIn is in valid e-mail format. return System.Text.RegularExpressions.Regex.IsMatch(strIn, @"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"); } 阅读全文

posted @ 2011-04-12 09:31 悟生慧 阅读(2936) 评论(0) 推荐(0)

2011年4月11日

ASP.NET如何让Label控件的Text值在10秒后清空?

摘要: 前台JS<script type="text/javascript"> function Clear() { setTimeout(function(){document.getElementById('<%=lblAddRess.ClientID%>').innerText='';}, 10000); return 0; } </script>后台if (!IsPostBack) { this.RegisterStartupScript("clear", "<scrip 阅读全文

posted @ 2011-04-11 21:28 悟生慧 阅读(1152) 评论(0) 推荐(0)

asp.NET中,密码输入框一刷新后输入的密码就清空,但刷新后保留刷新前输入的密码怎么做?

摘要: 在事件中赋值/// <summary> /// 属性改变时 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void txtPassWord_TextChanged(object sender, EventArgs e) { txtPassWord.Attributes["value"] = txtPassWord.Text; } 阅读全文

posted @ 2011-04-11 19:44 悟生慧 阅读(1103) 评论(0) 推荐(0)

上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 27 下一页

导航