上一页 1 ··· 7 8 9 10 11

2013年4月10日

七、初学.NET—GridView中添加行按钮实现查看详细信息

摘要: 前端:将需要跳转的页面中GridView中设置成模板列,使用HyperLink 的Navigate属性的第一个参数绑定数据,第二个是格式化参数实现页面跳转。<asp:TemplateField HeaderText="用户名" SortExpression="UserName"> <ItemTemplate> <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%#Eval("UserID&qu 阅读全文

posted @ 2013-04-10 19:07 众里寻他千万度 阅读(322) 评论(0) 推荐(0)

六、初学.NET—GridView每行添加提交按钮,提交后不能再次评审。

摘要: 前端:1、 给GridView中添加一模板列,将数据(ID)直接绑定到按钮的CommandArgument中,在RowCommand事件中的e.CommandArguemnt就能读出绑定的数据了。这样只能绑定一个数据。 要实现多数据绑定,通过CommandArgument=<’Container.DataItemIndex’>绑定行的索引号。2、要实现不能重复提交,要使用LinkButton 的Enabled属性使用后台方法进行格式化,返回True或者False。<asp:TemplateField HeaderText="基本操作> <ItemTemp 阅读全文

posted @ 2013-04-10 19:04 众里寻他千万度 阅读(258) 评论(0) 推荐(0)

五、初学.NET—Gridview自动编号和鼠标停留行加背景

摘要: 前端:在GridView中添加一普通绑定列<asp:BoundField HeaderText="序号" ItemStyle-Width="60px"><ItemStyle Width="60px"></ItemStyle> </asp:BoundField>后台:通过RowDataBound事件处理代码后台绑定,鼠标停留一行加背景protected void gv_ReviewOption_RowDataBound(object sender, GridViewRowEventArgs 阅读全文

posted @ 2013-04-10 19:01 众里寻他千万度 阅读(185) 评论(0) 推荐(0)

四、初学.NET—Gridview外部按钮选中、删除一行

摘要: 前端:.apx首先:设置GridView的DataKeyNames属性字段为数据表的主键<asp:GridView ID="gv_ReviewOption" runat="server" AutoGenerateColumns="False" DataKeyNames="ReviewOptionID" />在GridView中添加一模板列:<asp:TemplateField HeaderText="选择" ItemStyle-Width="60px"> 阅读全文

posted @ 2013-04-10 18:58 众里寻他千万度 阅读(377) 评论(0) 推荐(0)

三、初学.NET—Gridview的分页

摘要: 前端:.aspx首先在GridView中启用分页<asp:GridView ID="gv_ReviewIndex" runat="server" AllowPaging="True" />设置分页模式,可以在IDE环境中操作<PagerSettings FirstPageText="首页" LastPageText="末页" Mode="NextPreviousFirstLast" NextPageText="下一页" PreviousP 阅读全文

posted @ 2013-04-10 18:57 众里寻他千万度 阅读(173) 评论(0) 推荐(0)

二、初学.NET—Gridview的排序

摘要: 前端:.aspx首先设置GirdView的AllowSorting属性为True<asp:GridView ID="gv_ReviewIndex" runat="server" AllowPaging="True" AllowSorting="True" />每一列,包括模板列设置SortExpression需要排序的字段名<asp:TemplateField HeaderText="评审分数" SortExpression="ReviewSumScore" 阅读全文

posted @ 2013-04-10 18:56 众里寻他千万度 阅读(208) 评论(0) 推荐(0)

一、初学.NET—数据库连接字符串

摘要: (一)、连接SQL Server字符串的几种方式(1)信任模式1、sConnectionString=@”Server=(local);Database=数据库名;Trusted_Connection=True;”2、sConnectionString=@”Data Source=(local);Initial Catalog=数据库名;Integragrated Security=SSPI”(2)身份验证模式:1、sConnectionString=@”Server=(local);DataBase=数据库名; ;User ID=sa;Password=sa;”2、sConnectionSt 阅读全文

posted @ 2013-04-10 18:55 众里寻他千万度 阅读(271) 评论(0) 推荐(0)

上一页 1 ··· 7 8 9 10 11

导航