摘要: [转]ASP.NET(C#)常用代码30例1. 打开新的窗口并传送参数: 传送参数: response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>") 接收参数: string a = Request.QueryString("id"); string b = Request.QueryString("id1"); 2.为按钮添加对话框 Bu 阅读全文
posted @ 2012-09-05 22:52 stevejson 阅读(200) 评论(0) 推荐(0) 编辑
摘要: [转]ASP.NET(C#)常用代码30例1. 打开新的窗口并传送参数: 传送参数: response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>") 接收参数: string a = Request.QueryString("id"); string b = Request.QueryString("id1"); 2.为按钮添加对话框 Bu 阅读全文
posted @ 2012-09-05 22:50 stevejson 阅读(131) 评论(0) 推荐(0) 编辑
摘要: <asp:TemplateField> <ItemTemplate> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /></ItemTemplate></asp:TemplateField> =============================================protected void Button1_Click(objec 阅读全文
posted @ 2012-09-05 22:40 stevejson 阅读(436) 评论(0) 推荐(0) 编辑
摘要: public static bool IsInt(string value) { return Regex.IsMatch(value, @"^[+-]?\d*$"); } 阅读全文
posted @ 2012-09-05 22:34 stevejson 阅读(398) 评论(0) 推荐(0) 编辑
摘要: //在iframe加载的窗体中,控制父窗体div隐藏,并调用父窗体按钮事件 Response.Write("<script>parent.document.all.SearchDiv.style.display='none';parent.document.all.BlackDiv.style.display='none';parent.document.all.BtnShow.click();</script>");//在iframe加载的窗体中,控制父窗体div隐藏 Response.Write("< 阅读全文
posted @ 2012-09-05 22:32 stevejson 阅读(225) 评论(0) 推荐(0) 编辑
摘要: <script language="javascript" type="text/javascript"> function ShowSearch1() { document.getElementById('Search1').style.display ="none"; document.getElementById('Search2').style.display ="block"; document.getElementById('Link1').s 阅读全文
posted @ 2012-09-05 21:45 stevejson 阅读(391) 评论(0) 推荐(0) 编辑
摘要: 绑定时直接设置 某列隐藏,会出错下面有两种方法,不仅可以隐藏,还仍然可以正常取值方法一: 在RowCreated事件中书写如下代码 void GridView1_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow || e.Row.RowType == DataControlRowType.Header) { e.Row.Cells[0].Visible = false; //如果想使第1列不可见,则将它的可见性设为false } ... 阅读全文
posted @ 2012-09-05 21:43 stevejson 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 1. 创建通用的分页存储过程,sql2000,传入 表名,返回的列,查询条件,排序条件 CREATE procedure sp_Public_List ( @TableName varchar(50), @Cols varchar(1000), @strWhere varchar(8000), @strOrder varchar(100), @startIndex int, @endIndex int, @docount bit) as set nocount on if(@docount=1) exec ('select count(*) from ' + @TableNam 阅读全文
posted @ 2012-09-05 20:18 stevejson 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 文章出处:http://moosdau.cnblogs.com 作者:木只八刀在GridView中显示图片这里讨论的是, 增加一个图片列, 这样每一行记录都会附带一个小图片. 如下图所示:第一列是一个小图示, 第二列显示数据, 这样比单纯显示数据要漂亮许多. 在GridView 里显示图片, 大抵有两种办法: <1>添加 ImageField , 绑定到数据源的某一列. <2>编辑模板, 添加一个带Image 的列. 以下详述两种方法: <1>添加一个gridview 到页面, 点选它的任务菜单"编辑列", 在弹出的编辑框中, 选择Ima 阅读全文
posted @ 2012-09-05 20:01 stevejson 阅读(246) 评论(0) 推荐(0) 编辑