sisibest

导航

随笔分类 -  asp.net

使用LINQ取得已选中的CheckBox .
摘要:1.IList<string> FeildList = (from ListItem li in cblFeild.Items where li.Selected select li.Value).ToList(); string[] UpperIDs = FeildList.ToArray<String>();2. <toolkit:WrapPanel Name="wrpContainer" > <CheckBox Content="CheckBox1" Height="16" Name=& 阅读全文

posted @ 2013-03-19 17:51 sisibest 阅读(193) 评论(0) 推荐(0)

SQL
摘要:USE [ChinaCharity]GO/****** Object: StoredProcedure [dbo].[UP_GetDeliveryPointByCity] Script Date: 03/01/2013 17:44:26 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGO/*declare @TotalCount INTexec [UP_GetDeliveryPointByCity] -1,-1,-1,-1,@TotalCount outputselect @TotalCount*/ALTER PROC [dbo].[UP_ 阅读全文

posted @ 2013-03-01 20:39 sisibest 阅读(168) 评论(0) 推荐(0)

图片上传
摘要:protected void btnUpload_Click(object sender, EventArgs e) { Button btnupload = sender as Button; if (btnupload.ID.Equals("btnUpload"))//待补中的上传 { if (!fuFileUp.HasFile) { //ScriptManager.RegisterClientScriptBlock(this.upAttachment, this.GetType(), "", "alert('请选择要上传的文件!& 阅读全文

posted @ 2013-02-25 16:14 sisibest 阅读(179) 评论(0) 推荐(0)

客户端控件不能用visible 服务端控件才可以
摘要:<td style="padding-left: 0px; padding-right: 0px" align="center"> <div class="DivAutoHidden" title='<%#Eval("LogisticsNumber")%>' style='<%# "width: 100px;"+(Eval("Status").ToString()!="1"?"" 阅读全文

posted @ 2013-02-22 11:16 sisibest 阅读(137) 评论(0) 推荐(0)

只能输入数字
摘要:<script type="text/javascript" language="javascript"> function myKeyDown() { var k = window.event.keyCode; if ((k == 46) || (k == 8) || (k == 189) || (k == 109) || (k == 190) || (k == 110) || (k >= 48 && k <= 57) || (k >= 96 && k <= 105) || (k &g 阅读全文

posted @ 2013-01-31 16:59 sisibest 阅读(137) 评论(0) 推荐(0)

asp.net 批量更新
摘要:public bool UpdateInventory(DataTable dt,string user) { using (SqlConnection connection = new SqlConnection(DBUtility.DbHelperSQL.connectionString)) { SqlDataAdapter da = new SqlDataAdapter(); da.UpdateCommand = new SqlCommand("Update Inventory set LogisticsNumber=@LogisticsNumber, ModifyBy= 阅读全文

posted @ 2013-01-21 17:33 sisibest 阅读(143) 评论(0) 推荐(0)

For 循环 和Foreach 的区别
摘要:在固定长度或长度不需要计算的时候for循环效率高于foreach.在不确定长度,或计算长度有性能损耗的时候,用foreach比较方便.并且foreach的时候会锁定集合中的对象.期间不能修改. 阅读全文

posted @ 2013-01-07 15:46 sisibest 阅读(239) 评论(0) 推荐(0)

window.showModalDialog刷新父窗口和本窗口的方法及注意
摘要:在点击window.showModalDialog窗口的链接的时候会打开新窗口,想要阻止打开新窗口,需要在窗口页面中的html和body之间 加入: <base target="_self" />即可 阅读全文

posted @ 2013-01-06 15:47 sisibest 阅读(130) 评论(0) 推荐(0)

输入正确的邮箱地址
摘要:<td> <asp:TextBox ID="txtEmail" runat="server" Width="160px"></asp:TextBox> <asp:RegularExpressionValidator ID="revEmail" runat="server" ErrorMessage="请输入正确的邮箱地址!" Display="None" ValidationGroup="1" 阅读全文

posted @ 2013-01-06 14:07 sisibest 阅读(554) 评论(0) 推荐(0)

密码 必须大于六位
摘要:function Validator_CheckPassword(source, args) { var result = true; var password = $("#<%=txtPassword.ClientID %>").val(); if ($.trim(password) != '') { if ($.trim(password).length < 6) { result = false; } } args.IsValid = result; }<td> <asp:TextBox ID="txtPa 阅读全文

posted @ 2013-01-06 14:02 sisibest 阅读(563) 评论(0) 推荐(0)

SQL 拿到一天内的数据
摘要:CreateDate>=startDate&& CreateDate<=endDateif (!string.IsNullOrEmpty(startDate)) { sbWhere.Append(" and DATEDIFF(day,CreateDate,'"+startDate+"')<=0"); } if (!string.IsNullOrEmpty(endDate)) { sbWhere.Append(" and DATEDIFF(day,CreateDate,'"+en 阅读全文

posted @ 2013-01-06 11:39 sisibest 阅读(225) 评论(0) 推荐(0)

GridView中DropDownList联动
摘要:GridView中DropDownList联动2010-07-30 00:26 by Jun2009, 228 阅读, 0 评论, 收藏, 编辑1.在GridView模板列中添加DropDownList并设置AutoPostback属性为true。2.再在DropDownList的SelectedIndexChanged事件里写下面几句话。DropDownList ddl = (DropDownList)sender;//得到当前的DropDownListGridViewRow gvr = (GridViewRow)ddl.NamingContainer;//获取对DropDownList的容 阅读全文

posted @ 2012-12-17 15:54 sisibest 阅读(152) 评论(0) 推荐(0)

转载--从XML文件中读取数据绑定到DropDownList
摘要:1、绑定DropDownList: ddl_language.DataSource = createDataSource();ddl_language.DataTextField = "languageTextField";ddl_language.DataValueField = "languageValueField";ddl_language.DataBind();2、上面用到的createDataSource()方法: private ICollection createDataSource() { //create a data table t 阅读全文

posted @ 2012-12-17 15:50 sisibest 阅读(164) 评论(0) 推荐(0)

c#.net语句e.Row.RowType == DataControlRowType.DataRow是什么含义?
摘要:c#.net语句e.Row.RowType == DataControlRowType.DataRow是什么含义?事件语句 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells[3].Text = Convert.ToDateTime(e.Row.Cells[3].Text).ToShortDateString(); } } 中 e.Row.RowType 是什么意思 阅读全文

posted @ 2012-12-17 11:02 sisibest 阅读(1453) 评论(0) 推荐(0)