aspx页面代码:
<form id="Form1" οnkeydοwn="enterkey()" method="post" runat="server">
<table class="fullwidth" align="center">
<tr>
<td vAlign="bottom" height="30">
<table class="Subheader" height="26" cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td align="right" width="3"><IMG height="26" src="../../images/img_left_cs_header.gif" width="3"></td>
<td class="Subheader" align="center" bgColor="#00396b"><font color="#ffffff">零件/工时 </font>
</td>
<td width="4"><IMG height="26" src="../../images/img_right_cs_header.gif" width="3"></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<TABLE class="fullwidth" align="center">
<TR class="tr32a4">
<TD>父类型<br>
Parent Type :</TD>
<TD colSpan="3"><asp:radiobuttonlist id="rdbtnType" runat="server" AutoPostBack="True" RepeatDirection="Horizontal">
<asp:ListItem Value="0" Selected="True">主要零件<br /> Main Parts</asp:ListItem>
<asp:ListItem Value="1">机械零件<br /> Mechanical Parts</asp:ListItem>
<asp:ListItem Value="2">工时<br /> Labour</asp:ListItem>
</asp:radiobuttonlist></TD>
</TR>
<tr class="tr32e6">
<td>零件编号<br>
Part No. :</td>
<td><asp:textbox id="txtSearchNo" runat="server"></asp:textbox><FONT face="Times Roman New"> </FONT>
<asp:imagebutton id="imgSearchNo" runat="server" ImageUrl="../../images/img_search_icon.gif"></asp:imagebutton></td>
<td>零件说明<br>
Part Description :</td>
<td><asp:textbox id="txtSearchDesc" runat="server"></asp:textbox><FONT face="Times Roman New"> </FONT>
<asp:imagebutton id="imgSearchDesc" runat="server" ImageUrl="../../images/img_search_icon.gif"></asp:imagebutton></td>
</tr>
</TABLE>
<table class="fullwidth" align="center">
<tr>
<td><asp:datagrid id="dgPart" runat="server" BackColor="#E6E6E6" Width="100%" DataKeyField="ID" AllowPaging="True"
PageSize="8" CellPadding="3" BorderColor="White" AutoGenerateColumns="False" AllowSorting="True">
<AlternatingItemStyle BackColor="#A4A3A3"></AlternatingItemStyle>
<ItemStyle Height="20px"></ItemStyle>
<HeaderStyle Font-Bold="True" Height="23px" Width="40px" BackColor="#FFCC00"></HeaderStyle>
<Columns>
<asp:BoundColumn ReadOnly="True" HeaderText="编号<br/>ID">
<HeaderStyle Width="5%"></HeaderStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="PartAttributeType" SortExpression="PartAttributeType" ReadOnly="True"
HeaderText="零件属性类型<br/>PartAttributeType">
<HeaderStyle Width="20%"></HeaderStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="PartNo" SortExpression="PartNo" HeaderText="零件编号<br/>Part No">
<HeaderStyle Width="15%"></HeaderStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="PartDescription" SortExpression="PartDescription" HeaderText="描述<br/>Description">
<HeaderStyle Width="20%"></HeaderStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="UnitofMeasure" HeaderText="度量单位<br/>Unit of Measure">
<HeaderStyle Width="10%"></HeaderStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="GroupIndex" SortExpression="GroupIndex" HeaderText="组<br/>Group">
<HeaderStyle Width="10%"></HeaderStyle>
</asp:BoundColumn>
<asp:EditCommandColumn ButtonType="LinkButton" UpdateText="更新" CancelText="取消" EditText="编辑">
<HeaderStyle Width="8%"></HeaderStyle>
</asp:EditCommandColumn>
<asp:ButtonColumn Text="删除" CommandName="Delete">
<HeaderStyle Width="12%"></HeaderStyle>
</asp:ButtonColumn>
<asp:BoundColumn Visible="False" DataField="Creator" ReadOnly="True"></asp:BoundColumn>
<asp:BoundColumn Visible="False" DataField="CreateDate" ReadOnly="True"></asp:BoundColumn>
<asp:BoundColumn Visible="False" DataField="LastModifier" ReadOnly="True"></asp:BoundColumn>
<asp:BoundColumn Visible="False" DataField="LastModifyDate" ReadOnly="True"></asp:BoundColumn>
</Columns>
<PagerStyle Mode="NumericPages" NextPageText=" 下一页&gt;" PrevPageText="&lt;上一页"></PagerStyle>
</asp:datagrid></td>
</tr>
</table>
<table class="fullwidth" align="center">
<TR>
<TD>
<DIV align="right"><asp:imagebutton id="imbtnAdd" runat="server" ImageUrl="../../images/but_Add.gif"></asp:imagebutton></DIV>
</TD>
</TR>
</table>
<asp:panel id="PanelAdd" runat="server" Visible="False">
<TABLE class="fullwidth" align="center">
<TR class="tr32e6">
<TD>零件属性<BR>
Part Attribute :</TD>
<TD>
<asp:DropDownList id="ddlAttribute" runat="server" Width="200px"></asp:DropDownList></TD>
</TR>
<TR class="tr32a4">
<TD>零件/工时描述<BR>
Part Desc :</TD>
<TD>
<asp:textbox id="txtDesc" runat="server" Width="400px" MaxLength="255"></asp:textbox>*</TD>
</TR> <!--
<TR class="tr32e6">
<TD>零件/工时编号<BR>
Part No :</TD>
<TD>
<asp:textbox id="txtNo" runat="server" Width="200px" MaxLength="24"></asp:textbox>*</TD>
</TR>
-->
<TR class="tr32e6">
<TD>度量单位<BR>
Unit of Measure :</TD>
<TD>
<asp:textbox id="txtUnitofMeasure" runat="server" Width="200px" MaxLength="255"></asp:textbox></TD>
</TR>
<TR class="tr32a4">
<TD>组<BR>
Group :</TD>
<TD>
<asp:textbox id="txtGroup" runat="server" Width="200px" MaxLength="255">0</asp:textbox></TD>
</TR>
</TABLE>
<BR>
<TABLE class="fullwidth" align="center">
<TR>
<TD align="right" width="80%">
<asp:imagebutton id="imgbtnSave" runat="server" ImageUrl="../../images/but_submit.gif"></asp:imagebutton></TD>
<TD align="right">
<asp:imagebutton id="imgbtnCancel" runat="server" ImageUrl="../../images/but_cancel.gif"></asp:imagebutton></TD>
</TR>
</TABLE>
</asp:panel></form>