ipt>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
</asp:ScriptManager>
<div>
<asp:GridView ID="gvCategories" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="chkSelect" runat="server" onclick="editMode(this)" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Category Name">
<ItemTemplate>
<asp:TextBox ID="txtCategoryName" BorderWidth="0px" ForeColor="red" runat="server"
Text=''<%# Eval("CategoryName") %>'' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Description">
<ItemTemplate>
<asp:TextBox ID="txtDescription" BorderWidth="0px" ForeColor="red" runat="server"
Text=''<%# Eval("Description") %>'' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HiddenField Value=''<%# Eval("CategoryID") %>'' ID="hiddenId" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<input type="button" runat="server" id="btnUpdate" value="更新" onclick="updateMode(this)" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%contentnbsp;ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT * FROM [Categories]"></asp:SqlDataSource>
</div>
</form>
</body>
</html>
<script>
disableGridViewTextBoxes();
</script>
运行