Tom-Net

导航

简单的GridView的操作1

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UpdateClass.aspx.cs" Inherits="managertianxia_UpdateClass" Debug="true" %>

<%@ Register Src="controls/top.ascx" TagName="top" TagPrefix="uc2" %>
<%@ Register Src="controls/bottom.ascx" TagName="bottom" TagPrefix="uc3" %>
<%@ Register Src="controls/left.ascx" TagName="left" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>烟酒天下后台管理系统</title>
    <link href="../managertianxia/css/css.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
   <div id="top">
       <uc2:top ID="Top1" runat="server" />
   </div>
    <div id="main">
    <div id="left">
        <uc1:left ID="Left1" runat="server" />
    </div>
    <div id="right">
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" OnPageIndexChanging="GridView1_PageIndexChanging" OnSelectedIndexChanging="GridView1_SelectedIndexChanging">
            <Columns>
                <asp:BoundField DataField="Class_Id" HeaderText="Id" />
                <asp:BoundField DataField="Class_Name" HeaderText="类名" />
                <asp:BoundField DataField="En_Class_Name" HeaderText="英文类名" />
                <asp:BoundField DataField="fathername" HeaderText="父类名" />
                <asp:BoundField DataField="Farther_Class_Id" HeaderText="父类id" />
                <asp:TemplateField HeaderText="是否有子节点">
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("IsHasChild").ToString() =="0"?"没有":"有" %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Add_Time" HeaderText="添加时间" />
                <asp:CommandField ShowSelectButton="True" />
            </Columns>
        </asp:GridView>
    <table cellSpacing="0" cellPadding="0" width="100%" border="0">
 <tr>
 <td height="25" width="30%" align="right">
        所属父类&nbsp;</td>
 <td height="25" width="*">
        <asp:DropDownList ID="drpFarther_Class_Id" runat="server" Width="491px">
        </asp:DropDownList>&nbsp;
 </td></tr>
 <tr>
 <td height="25" width="30%" align="right">
        类名&nbsp;</td>
 <td height="25" width="*">
  <asp:TextBox id="txtClass_Name" runat="server" Width="200px"></asp:TextBox>&nbsp;</td></tr>
 <tr>
 <td height="25" width="30%" align="right">
        英文类名&nbsp;</td>
 <td height="25" width="*">
  <asp:TextBox id="txtEn_Class_Name" runat="server" Width="200px"></asp:TextBox>&nbsp;</td></tr>
 <tr>
 <td height="25" width="30%" align="right">
        &nbsp;</td>
 <td height="25" width="*">
        <asp:Button ID="btnupdate" runat="server" Text="修改" OnClick="btnAdd_Click" />&nbsp;</td></tr>
 <tr>
 <td height="25" width="30%" align="right">
        &nbsp;</td>
 <td height="25" width="*">
        &nbsp;</td></tr>
 <tr>
 <td height="25" width="30%" align="right">
        &nbsp;</td>
 <td height="25" width="*">
        &nbsp;</td></tr>
</table>
    </div>
    </div>
    <div id="foot">
        <uc3:bottom ID="Bottom1" runat="server" />
    </div>
    </form>
</body>
</html>

posted on 2008-05-28 11:02  Tom_Net  阅读(125)  评论(0)    收藏  举报