您现在的位置是:首页 >

酒店有两个房间的是什么房型 ASP.NET项目开发指南:房间类型的添加(1)

火烧 2021-08-24 08:23:34 1040
ASP.NET项目开发指南:房间类型的添加(1)    房间类型的添加( )  在房间类型管理页面中单击 添加新房间类型 超链接 将打开ST_RCategoryAdd a x页面 可以在其中添加房间类

ASP.NET项目开发指南:房间类型的添加(1)  

     房间类型的添加( )

  在房间类型管理页面中单击 添加新房间类型 超链接 将打开ST_RCategoryAdd aspx页面 可以在其中添加房间类型 如图 所示

图   添加客房类型信息页面

   ST_RCategoryAdd aspx的HTML代码

  页面构架和前面的基本一样 只有<MODULE:RCategoryAdd id= ModuleRCategoryAdd runat= server > </MODULE:RCategoryAdd>不同 其HTML代码如程序 所示

  程序   ST_RCategoryAdd aspx

     <table cellSpacing= cellPadding= width= % >

         <tr class= rheader >

             <td class= rheadercol align= left height= colspan= >

                 添加客房类型信息

             </td>

         </tr>

         <! SPACER ROW >

         <tr class= rbody >

             <td class= rbodycol align= center height=

                 colspan= >&nbsp;

             </td>

         </tr>

         <tr class= rbody >

             <td class= rbodycol align= center height= colspan= >

酒店有两个房间的是什么房型 ASP.NET项目开发指南:房间类型的添加(1)

                 <P><asp:label id= CreateLabel enableViewState= false

                 runat= server Visible= True >

              请完整填写下列信息 然后单击 添加 按钮来提交要添加的房间类型信息

               </asp:label></P>

                 <table style= BORDER RIGHT: #ccccff px solid;

                     TABLE LAYOUT: auto; BORDER TOP: #ccccff px solid;

                     BORDER LEFT: #ccccff px solid;

                     BORDER BOTTOM: #ccccff px solid; BORDER COLLAPSE:

                     collapse width= % >

                     <tr style= BACKGROUND COLOR: #ccccff >

                         <td width= % >类型名称

                         </td>

                         <td><asp:textbox id= RCatgNameTextBox

                             enableViewState= false runat= server

                             MaxLength= ></asp:textbox>(必填)

                             <asp:requiredfieldvalidator

                         id= RequiredFieldValidator runat= server

                         controlToValidate= RCatgNameTextBox

                                 errormessage= 类型名称必须填写

                     display= dynamic >*</asp:requiredfieldvalidator>

                             <asp:customvalidator

                         id= IdUniqueCustomValidator runat= server

                         ErrorMessage= 该类型已存在

                         ControlToValidate= RCatgNameTextBox

                                 OnServerValidate= IsNameValidate >*

                     </asp:customvalidator></td>

                     </tr>

                     <tr>

                         <td width= % >房间面积(平方米)

                         </td>

                         <td><asp:textbox id= AreaTextBox

                     enableViewState= false runat= server

                     MaxLength= ></asp:textbox>(必填)

                             <asp:requiredfieldvalidator

                 id= RequiredFieldValidator runat= server

                 controlToValidate= AreaTextBox

                 errormessage= 房间面积必须填写

                 display= dynamic >*</asp:requiredfieldvalidator></td>

                     </tr>

                     <tr style= BACKGROUND COLOR: #ccccff >

                         <td width= % >床位(个)

                         </td>

                         <td><asp:textbox id= BedNumTextBox

                         enableViewState= false runat= server

                         MaxLength= ></asp:textbox>(必填)

                     <asp:requiredfieldvalidator

                     id= RequiredFieldValidator runat= server

                         controlToValidate= BedNumTextBox

                     errormessage= 床位必须填写

             display= dynamic >*</asp:requiredfieldvalidator></td>

                     </tr>

                     <tr>

                         <td width= % >价格(元/日)

                         </td>

                         <td><asp:textbox id= PriceTextBox

                     enableViewState= false runat= server

                     MaxLength= ></asp:textbox>(必填)

                     <asp:requiredfieldvalidator

                     id= RequiredFieldValidator runat= server

                     controlToValidate= PriceTextBox

                     errormessage= 价格必须填写

                 display= dynamic >*</asp:requiredfieldvalidator></td>

                     </tr>

                     <tr style= BACKGROUND COLOR: #ccccff >

                         <td width= % >空调

                         </td>

                     <td><asp:radiobuttonlist id= AirConditionList

                     Runat= server RepeatColumns= >

                     <asp:ListItem Selected= True >有

                     </asp:ListItem>

                     <asp:ListItem>无</asp:ListItem>

                     </asp:radiobuttonlist>

                         </td>

                     </tr>

                     <tr>

                         <td width= % >有线电视

                         </td>

                     <td><asp:radiobuttonlist id= TvList

                         Runat= server RepeatColumns= >

                                 <asp:ListItem Selected= True >有

                         </asp:ListItem>

                                 <asp:ListItem>无</asp:ListItem>

                     </asp:radiobuttonlist>

             <tr>

             <td colspan= ><asp:validationsummary

            id= ValidationSummary runat= server

            HeaderText= 请按下面提示正确填写 ></asp:validationsummary></td>

        </tr>

        <tr>

            <td width= % >&nbsp;

            </td>

            <td>

                <asp:Button id= SubmitButton text= 添加

                BorderStyle= Groove

                runat= server ></asp:Button>&nbsp;&nbsp;&nbsp;&nbsp;

                <asp:Button id= ReturnButton CausesValidation= False

            BorderStyle= Groove text= 返回 runat= server ></asp:Button>

            </td>

        </tr>

        <tr>

            <td colspan= ><asp:label id= ShowMsg

            Runat= server ></asp:label></td>

        </tr>

   </table>

  【代码说明】上述代码演示了输入控件文本框的验证方法 这里使用了 个验证控件requiredfieldvalidator分别对 个文本框进行了必须填写的验证 然后在第 ~ 行还通过validationsummary控件统一显示了所有的验证错误

  说明 ValidationSummary控件不与任何控件进行绑定 这是与其他验证控件的区别

      返回目录ASP NET项目开发指南

      编辑推荐

       ASP NET MVC 框架揭秘

       ASP NET开发宝典

lishixinzhi/Article/program/net/201311/15982  
永远跟党走
  • 如果你觉得本站很棒,可以通过扫码支付打赏哦!

    • 微信收款码
    • 支付宝收款码