- 浏览: 7863028 次
- 性别:
- 来自: 广州
文章分类
- 全部博客 (2425)
- 软件工程 (75)
- JAVA相关 (662)
- ajax/web相关 (351)
- 数据库相关/oracle (218)
- PHP (147)
- UNIX/LINUX/FREEBSD/solaris (118)
- 音乐探讨 (1)
- 闲话 (11)
- 网络安全等 (21)
- .NET (153)
- ROR和GOG (10)
- [网站分类]4.其他技术区 (181)
- 算法等 (7)
- [随笔分类]SOA (8)
- 收藏区 (71)
- 金融证券 (4)
- [网站分类]5.企业信息化 (3)
- c&c++学习 (1)
- 读书区 (11)
- 其它 (10)
- 收藏夹 (1)
- 设计模式 (1)
- FLEX (14)
- Android (98)
- 软件工程心理学系列 (4)
- HTML5 (6)
- C/C++ (0)
- 数据结构 (0)
- 书评 (3)
- python (17)
- NOSQL (10)
- MYSQL (85)
- java之各类测试 (18)
- nodejs (1)
- JAVA (1)
- neo4j (3)
- VUE (4)
- docker相关 (1)
最新评论
-
xiaobadi:
jacky~~~~~~~~~
推荐两个不错的mybatis GUI生成工具 -
masuweng:
(转)JAVA获得机器码的实现 -
albert0707:
有些扩展名为null
java 7中可以判断文件的contenttype了 -
albert0707:
非常感谢!!!!!!!!!
java 7中可以判断文件的contenttype了 -
zhangle:
https://zhuban.me竹板共享 - 高效便捷的文档 ...
一个不错的网络白板工具
asp2.0中formview+dropdown控件小DEMO,演示了如何对northwind数据库中的product表进行更改,其中可以对某个产品的所属分类用dropdownlist进行更改,可以注意下formview和dropdownlist的用法
<body>
<form id="form1" runat="server">
<div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [ProductID], [ProductName], [CategoryID] FROM [Products]"
UpdateCommand="UPDATE [Products] SET [ProductName]=@productname,[CategoryID] =@categoryid WHERE [ProductID] = @productid">
<UpdateParameters>
<asp:Parameter Name="ProductName" Type="String" />
<asp:Parameter Name="CategoryID" Type="Int32" />
<asp:Parameter Name="ProductID" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</div>
<asp:FormView ID="FormView1" runat="server" AllowPaging="True" DataKeyNames="ProductID"
DataSourceID="SqlDataSource1">
<EditItemTemplate>
ProductID:
<asp:Label ID="ProductIDLabel1" runat="server" Text='<%# Eval("ProductID") %>'></asp:Label><br />
ProductName:
<asp:TextBox ID="ProductNameTextBox" runat="server" Text='<%# Bind("ProductName") %>'>
</asp:TextBox><br />
CategoryID:
<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource2"
DataTextField="CategoryName" DataValueField="CategoryID" SelectedValue='<%# Bind("CategoryID") %>'>
</asp:DropDownList><br />
(<asp:Label ID="CategoryIDLabel" runat="server" Text='<%# Eval("CategoryID") %>' />)<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"
Text="Update">
</asp:LinkButton>
<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
Text="Cancel">
</asp:LinkButton>
</EditItemTemplate>
<InsertItemTemplate>
ProductName:
<asp:TextBox ID="ProductNameTextBox" runat="server" Text='<%# Bind("ProductName") %>'>
</asp:TextBox><br />
CategoryID:
<asp:TextBox ID="CategoryIDTextBox" runat="server" Text='<%# Bind("CategoryID") %>'>
</asp:TextBox><br />
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
Text="Insert">
</asp:LinkButton>
<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
Text="Cancel">
</asp:LinkButton>
</InsertItemTemplate>
<ItemTemplate>
ProductID:
<asp:Label ID="ProductIDLabel" runat="server" Text='<%# Eval("ProductID") %>'></asp:Label><br />
ProductName:
<asp:Label ID="ProductNameLabel" runat="server" Text='<%# Bind("ProductName") %>'></asp:Label><br />
CategoryID:
<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="Sqldatasource2" DataTextField="CategoryName" DataValueField="CategoryID" SelectedValue='<%# Eval("CategoryID") %>' Enabled="False" />
(<asp:Label ID="CategoryIDLabel" runat="server" Text='<%# Eval("CategoryID") %>'/>)
<asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit" />
</ItemTemplate>
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [CategoryID], [CategoryName] FROM [Categories]"></asp:SqlDataSource>
</form>
</body>
<body>
<form id="form1" runat="server">
<div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [ProductID], [ProductName], [CategoryID] FROM [Products]"
UpdateCommand="UPDATE [Products] SET [ProductName]=@productname,[CategoryID] =@categoryid WHERE [ProductID] = @productid">
<UpdateParameters>
<asp:Parameter Name="ProductName" Type="String" />
<asp:Parameter Name="CategoryID" Type="Int32" />
<asp:Parameter Name="ProductID" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</div>
<asp:FormView ID="FormView1" runat="server" AllowPaging="True" DataKeyNames="ProductID"
DataSourceID="SqlDataSource1">
<EditItemTemplate>
ProductID:
<asp:Label ID="ProductIDLabel1" runat="server" Text='<%# Eval("ProductID") %>'></asp:Label><br />
ProductName:
<asp:TextBox ID="ProductNameTextBox" runat="server" Text='<%# Bind("ProductName") %>'>
</asp:TextBox><br />
CategoryID:
<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource2"
DataTextField="CategoryName" DataValueField="CategoryID" SelectedValue='<%# Bind("CategoryID") %>'>
</asp:DropDownList><br />
(<asp:Label ID="CategoryIDLabel" runat="server" Text='<%# Eval("CategoryID") %>' />)<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"
Text="Update">
</asp:LinkButton>
<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
Text="Cancel">
</asp:LinkButton>
</EditItemTemplate>
<InsertItemTemplate>
ProductName:
<asp:TextBox ID="ProductNameTextBox" runat="server" Text='<%# Bind("ProductName") %>'>
</asp:TextBox><br />
CategoryID:
<asp:TextBox ID="CategoryIDTextBox" runat="server" Text='<%# Bind("CategoryID") %>'>
</asp:TextBox><br />
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
Text="Insert">
</asp:LinkButton>
<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
Text="Cancel">
</asp:LinkButton>
</InsertItemTemplate>
<ItemTemplate>
ProductID:
<asp:Label ID="ProductIDLabel" runat="server" Text='<%# Eval("ProductID") %>'></asp:Label><br />
ProductName:
<asp:Label ID="ProductNameLabel" runat="server" Text='<%# Bind("ProductName") %>'></asp:Label><br />
CategoryID:
<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="Sqldatasource2" DataTextField="CategoryName" DataValueField="CategoryID" SelectedValue='<%# Eval("CategoryID") %>' Enabled="False" />
(<asp:Label ID="CategoryIDLabel" runat="server" Text='<%# Eval("CategoryID") %>'/>)
<asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit" />
</ItemTemplate>
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [CategoryID], [CategoryName] FROM [Categories]"></asp:SqlDataSource>
</form>
</body>
发表评论
-
.NET 嵌入式版4.2发布:关键更新抢先看
2012-02-22 14:57 1842作为.NET家族的一员,.Net Micro Framewor ... -
asp.net中模拟测试smtp发信
2011-03-20 18:47 1881在asp.net 中,有时要测试发信SMTP,但如果在单元测试 ... -
vs.net 2010两个数据库方面的好工具
2011-02-14 11:47 1856今天发现vs.net 2010在处理数据库方面的两个不错的工具 ... -
将gridview导出到excel,world,pdf的小结
2011-02-07 22:47 2962下面小结下把gridview的数据导出到excel,world ... -
gridviewtips1:gridview的页脚中的加亮显示和页数显示
2011-01-27 09:58 2362在asp.net 中,要经常显示gridview中的页数,并且 ... -
asp.net 4中的HTML过滤的一个新特性
2011-01-21 09:47 1865在asp.net 4中,有个新增加的对HTML过滤,防止XSS ... -
在vs.net 2010中使用重构方法
2011-01-20 16:55 2165在vs.net 2010中,可以很方便地对一些冗余的代码进行重 ... -
一个比较好的.net 3.5的异常报告类
2011-01-10 14:51 1953发现了一个比较好的异常报告类,其中用到了.net 3.5以上的 ... -
asp.net 4.0中menu菜单的改进
2011-01-03 22:47 2576在asp.net 3.5时,如果用menucontrol时,使 ... -
asp.net 4中的新特性之一:控制URL长度
2010-09-14 23:06 2392asp.net 4中的新特性之一:控制URL长度。在ASP.N ... -
vs.net 2010中使用code snippets
2010-09-09 20:58 1583其实在vs.net 2010中,使用code snippets ... -
百万开发者拥戴!七大.NET著名开源项目
2010-09-07 09:42 2295新翻译了篇帖子,原文发表在 http://publish.i ... -
asp.net 2010中jquery调用webservice
2010-08-30 22:21 2760在asp.net 2010中,在建立web应用时,默认已经在s ... -
.net中的placeholder控件
2005-01-15 20:00 1936最近留意到有人问,NET中的placeholder控件用来做什 ... -
asp.net 中一次性更新DATAGRID中所有记录
2005-01-15 20:03 947在asp.net中,如何一次性 ... -
在asp.net 中实现只允许数字输入的文本框
2005-01-15 20:18 1496在asp.net 中实现只允许数字输入的文本框,其实是十分简单 ... -
一个重构代码的小技巧
2005-01-16 21:58 1142刚开始接触重构,听就听的多了,理论没认真看过,不过今天发现,将 ... -
防止SQL注入攻击
2005-02-05 14:42 1152看了本期ASP。NET杂志里的一篇讲防止SQL注入攻击的文章, ... -
优秀.net 控件包介绍
2005-02-18 19:47 1682在oday上看到得,将介绍摘录在这里 NetAdvantage ... -
vs.net 2005中的ConfigurationManager
2005-05-06 18:11 1645vs.net 2005中的ConfigurationManag ...
相关推荐
这是用vs建的一个例子,关于GridView控件和FormView控件的。
ASP.NET2.0中编程实现GridView与FormView的主-详细视图
在ASP.NET 2.0中操作数据:使用FormView 的模板(源码)
第3章 ASP.NET 2.0常用服务器控件 3.1 使用基本控件 3.1.1 TextBox控件的应用 3.1.2 Label控件的应用 3.1.3 DropDownList和ListBox控件应用 3.1.4 CheckBOX和CheckBoxList控件应用 3.1.5 RadioButton和...
在ASP.NET 2.0中操作数据:使用FormView 的模板
Python 中的 Python Django FormView 框架+FormView 的特点+优点 在实际的开发中, 如果我们需要处理表单数据, 优先考虑使用 FormView。 它可以大大减少我们的开发时间, 同时也可以帮助我们更 加专注于业务逻辑。
FormView控件的运用
GridView_+_FormView_+_SqlDataSource
【ASP.NET编程知识】在ASP.NET 2.0中操作数据之十四:使用FormView 的模板.docx
内容简介回到顶部↑本书全面介绍了ASP.NET各种编程技能和2.0版中的巨大变化,并详细阐述了2.0版中的每个新特性。书中提供了大量的实例,可帮助读者快速掌握如何在.NET平台下开发功能强大的ASP.NET应用程序。本书适合...
15.1 GridView控件 266 15.1.1 绑定数据到GridView控件 266 15.1.2 数据排序并进行分页 267 ...15.5.2 在使用GridView控件的过程中要注意什么 284 15.5.3 如何在用GridView控件浏览数据时插入新数据 284
当使用GridView、DetailsView或FormView控件的内建插入、编辑或删除特征时,在用户添加一条新记录或更新/删除一条现在记录的过程中发生了多个步骤。正如我们之前一节里所讨论的,在GridView中编辑一行时,保存...
一、简介 从ASP.NET 2.0起引入了一批新的功能强大的视图控件,例如Gridview、FormView和DetailsView等等。通过和数据源控件的简单结合,在许多情况下,仅需要简单的配置方式就可以开发出功能强大的应用程序。但遗憾...
示例描述:本章演示ASP.NET 2.0网站的预编译以及学习ASP.NET 2.0的前置知识。 WebSite文件夹 创建的ASP.NET 2.0 Web站点。 www文件夹 第一个用C#开发的Web应用程序。 bianyi.bat 编译网站的批处理文件。 ...
本书全面介绍了ASP.NET各种编程技能和2.0版中的巨大变化,并详细阐述了2.0版中的每个新特性。书中提供了大量的实例,可帮助读者快速掌握如何在.NET平台下开发功能强大的ASP.NET应用程序。本书适合有一些基础的ASP...
在GridView控件中使用TemplateField 在DetailsView控件中使用TemplateField 使用FormView 的模板 在GridView的页脚中显示统计信息 编辑插入和删除数据 概述插入、更新和删除数据 研究插入、更新和删除的关联...
ASP.NET的五大数据控件浅谈ASP.NET的五大数据控件浅谈GridView,DataList,Repeater ,DetailsView,FormView。GridView,DataList,Repeater ,DetailsView,FormView。
ASP.NET 2.0在Web应用程序开发方面迈出了革命性的一步,新增了50多个服务器控件,类的数量也增加了一倍,其他许多方面也有很重大的变化。ASP.NET 2.0的目标是提高开发人员的效率、改善应用程序的性能和可伸缩性...
这里是asp.net2.0常用数据绑定控件的应用,是我写的用来教学的示例,有sqlserver2000数据库文件。
9.3 在SqlDataSource控件中使用ASP.NET参数 271 9.3.1 使用ASP.NET参数对象 272 9.3.2 使用ASP.NET的Control-Parameter对象 274 9.3.3 使用ASP.NET的Cookie-Parameter对象 277 9.3.4 使用ASP.NET的Form-Parameter...