ST_RCatgManModuleascx的HTML代碼
代碼中最主要的是GridView控件它負責顯示數據其他都是一些簡單的Web控件如程序所示
程序 ST_RCatgManModuleascx
<TABLE cellSpacing= cellPadding= width=%>
<TR class=rheader>
<TD class=rheadercol align=left colSpan= height=>
房間類型管理
</TD>
</TR> <! SPACER ROW >
<TR class=rbody>
<TD class=rbodycol align=left width=% height=
colspan=>按類型名稱<asp:textbox id=RNameTextBox runat=server
Width=px></asp:textbox>
<asp:button id=search runat=server Text=查詢
BorderStyle=Groove></asp:button></TD>
</TR>
<TR class=rbody>
<TD class=rbodycol align=center colSpan= height=>
<!GridView控件 >
<asp:GridView id=dg_RCategoryList runat=server
Width=% PageSize= AutoGenerateColumns=False
BorderColor=Black DataKeyNames=ST_RCategoryId
AllowPaging=True onrowdeleting =GridView_Delete
onpageindexchanging =GridView_Page>
<AlternatingRowStyle
BackColor=#CCCCFF></AlternatingRowStyle>
<HeaderStyle FontBold=True
BackColor=#CCCCFF></HeaderStyle>
<Columns>
<asp:BoundField DataField=ST_RCategoryId
SortExpression= HeaderText=編號></asp:BoundField>
<asp:BoundField DataField=ST_Name HeaderText=類型名稱>
</asp:BoundField>
<asp:BoundField DataField=ST_BedNum HeaderText=床位>
</asp:BoundField>
<asp:BoundField DataField=ST_Price HeaderText=價格>
</asp:BoundField>
<asp:HyperLinkField
DataNavigateUrlFields=ST_RCategoryId
DataNavigateUrlFormatString=
/ST_RCategoryEditaspx?RCategoryId={}
DataTextField=ST_RCategoryId HeaderText=修改
DataTextFormatString=詳單 />
<asp:ButtonField Text=刪除 HeaderText=刪除
CommandName=Delete ButtonType=Button>
</asp:ButtonField>
</Columns>
<PagerSettings NextPageText=下一頁 Mode=NextPrevious
PreviousPageText =上一頁 />
</asp:GridView>
</TD></TR>
<TR>
<td width=% height=>
<!鏈接到添加新房間>
<a id=AddRCategoryLink href=<%=ST_PageBaseUrlBase +
/ST_RCategoryAddaspx%>>添加新房間類型</a></td>
<TD align=right>
<asp:button id=ShowAll runat=server
BorderStyle=Groove Text=全部顯示
Visible=False></asp:button></TD>
</TR>
</TABLE>
返回目錄ASPNET項目開發指南
編輯推薦
ASPNET MVC 框架揭秘
ASPNET開發寶典
ASP NET開發培訓視頻教程
[] []
From:http://tw.wingwit.com/Article/program/net/201311/15988.html