asp.net创建控件,griwview设计出了问题。
<%@PageLanguage="C#"MasterPageFile="~/MasterPage.Master"AutoEventWireup="true"CodeBeh...
<%@ Page Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true"
CodeBehind="Mycart.aspx.cs" Inherits="tsxsgj.Mycart" Title="我的购物车" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:Label ID="LbMessage" runat="server" Text="Label" BackColor="Yellow"></asp:Label>
<br/>
<asp:GridView ID="GvCart" runat="server" AutoGenerateColumns="False"
CellPadding="4" ForeColor="#3333FF" GridLines="None"
OnRowDeleting="GvCart_RowDeleting"
onselectedindexchanged="GvCart_SelectedIndexChanged">
<FooterStyle BackColor="#1C5E55" Font-Bold="true" ForeColor="White" />
<Columns>
<asp:BoundField DataField ="Name" HeaderText="书名" />
<asp:BoundField DataField ="Author" HeaderText="作者" />
<asp:BoundField DataField ="Price" HeaderText="单价" />
<asp:BoundField DataField ="Description" HeaderText="备注" />
<asp:TemplateField HeaderText="数量" />
<ItemTeplate>
<asp:TextBox runat="server" ID="TbNumber" Text='<%#Bind("Number") %>'>
</asp:TextBox>
</ItemTeplate>
<asp:BoundField DataField ="Sum" HeaderText="金额" />
<asp:CommandField ButtonType="Button" ShowDeleteButton="true" />
</Columns>
</asp:GridView>
<asp:Label ID="LbTotal" runat="server" Text="Label" Font-Bold="True"
ForeColor="#00CC00" Visible="False"></asp:Label><br/>
<asp:Button ID="BtnConfirm" runat="server" Text="保存修改"
onclientclick="BtnConfirm_Click" Visible="False" />
<asp:Button ID="BtSubmit" runat="server" onclientclick="BtnSubmit_Click"
Text="提交订单" Visible="False" />
</asp:Content> 展开
CodeBehind="Mycart.aspx.cs" Inherits="tsxsgj.Mycart" Title="我的购物车" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:Label ID="LbMessage" runat="server" Text="Label" BackColor="Yellow"></asp:Label>
<br/>
<asp:GridView ID="GvCart" runat="server" AutoGenerateColumns="False"
CellPadding="4" ForeColor="#3333FF" GridLines="None"
OnRowDeleting="GvCart_RowDeleting"
onselectedindexchanged="GvCart_SelectedIndexChanged">
<FooterStyle BackColor="#1C5E55" Font-Bold="true" ForeColor="White" />
<Columns>
<asp:BoundField DataField ="Name" HeaderText="书名" />
<asp:BoundField DataField ="Author" HeaderText="作者" />
<asp:BoundField DataField ="Price" HeaderText="单价" />
<asp:BoundField DataField ="Description" HeaderText="备注" />
<asp:TemplateField HeaderText="数量" />
<ItemTeplate>
<asp:TextBox runat="server" ID="TbNumber" Text='<%#Bind("Number") %>'>
</asp:TextBox>
</ItemTeplate>
<asp:BoundField DataField ="Sum" HeaderText="金额" />
<asp:CommandField ButtonType="Button" ShowDeleteButton="true" />
</Columns>
</asp:GridView>
<asp:Label ID="LbTotal" runat="server" Text="Label" Font-Bold="True"
ForeColor="#00CC00" Visible="False"></asp:Label><br/>
<asp:Button ID="BtnConfirm" runat="server" Text="保存修改"
onclientclick="BtnConfirm_Click" Visible="False" />
<asp:Button ID="BtSubmit" runat="server" onclientclick="BtnSubmit_Click"
Text="提交订单" Visible="False" />
</asp:Content> 展开
4个回答
2012-03-23
展开全部
晕,把 <ItemTeplate>
<asp:TextBox runat="server" ID="TbNumber" Text='<%#Bind("Number") %>'>
</asp:TextBox>
</ItemTeplate>
改为
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox runat="server" ID="TbNumber" Text='<%#Bind("Number") %>'>
</asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TextBox runat="server" ID="TbNumber" Text='<%#Bind("Number") %>'>
</asp:TextBox>
</ItemTeplate>
改为
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox runat="server" ID="TbNumber" Text='<%#Bind("Number") %>'>
</asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
直接拖出来,在设计器编写代码,
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询