熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

11.6.1 Wrox United中的配置文件[2]

2022-06-13   來源: .NET編程 

    ()下一步是添加一些代碼到FanClubaspx頁面從而用戶可以存儲新的配置文件屬性並且查看或編輯已有的屬性打開該頁面並且添加如下突出顯示的代碼行有許多代碼需要添加但如同您將看到的那樣將要做的所有事情只是添加控件到頁面並且在表中布置它們

 

<asp:LoginView ID=FCLoginView runat=server>

    <RoleGroups>

      <asp:RoleGroup Roles=FanClubMember>

        <ContentTemplate>

          <p>

            Welcome back

            <asp:LoginName ID=FCLoginName runat=server />

            </p>

          <p>

            There are always lots of exciting things happening with the fan club

                           

            set but keep your eyes on your inbox for more details

          </p>

          <h>

            User Settings</h>

          <p>

            Your user details are shown below</p>

          <asp:ChangePassword ID=ChangePassword runat=server>

          </asp:ChangePassword>

          <br />

          <table border=>

            <tr>

              <td>

                Name:</td>

              <td>

                <asp:TextBox ID=txtName runat=server Columns= />

                <asp:RequiredFieldValidator ID=rfv runat=server ControlToValidate=txtName

                  Text=* ErrorMessage=You must enter a value for your name />

              </td>

            </tr>

            <tr>

              <td>

                Address:</td>

              <td>

                <asp:TextBox ID=txtAddress runat=server Columns= Rows= TextMode=multiLine />

                <asp:RequiredFieldValidator ID=RequiredFieldValidator runat=server ControlToValidate=txtAddress

                  Text=* ErrorMessage=You must enter a value for the address />

              </td>

            </tr>

            <tr>

              <td>

                City:</td>

              <td>

                <asp:TextBox ID=txtCity runat=server />

                <asp:RequiredFieldValidator ID=RequiredFieldValidator runat=server ControlToValidate=txtCity

                  Text=* ErrorMessage=You must enter a value for the city />

              </td>

            </tr>

            <tr>

              <td>

                County:</td>

              <td>

                <asp:TextBox ID=txtCounty runat=server />

                <asp:RequiredFieldValidator ID=RequiredFieldValidator runat=server ControlToValidate=txtCounty

                  Text=* ErrorMessage=You must enter a value for the county />

              </td>

            </tr>

            <tr>

              <td>

                Postcode:</td>

              <td>

                <asp:TextBox ID=txtPostCode runat=server />

                <asp:RequiredFieldValidator ID=RequiredFieldValidator runat=server ControlToValidate=txtPostCode

                  Text=* ErrorMessage=You must enter a value for the post code />

              </td>

            </tr>

            <tr>

              <td>

                Country:</td>

              <td>

                <asp:TextBox ID=txtCountry runat=server />

                <asp:RequiredFieldValidator ID=RequiredFieldValidator runat=server ControlToValidate=txtCountry

                  Text=* ErrorMessage=You must enter a value for the country />

              </td>

            </tr>

            <tr>

              <td>

                Subscribe to email updates:</td>

              <td>

                <asp:CheckBox ID=chkMailing runat=server /></td>

            </tr>

            <tr>

              <td>

                Email:<br />

              </td>

              <td>

                <asp:TextBox ID=txtEmail runat=server />

                <asp:RequiredFieldValidator ID=RequiredFieldValidator runat=server ControlToValidate=txtEmail

                  Text=* ErrorMessage=You must enter a value for the email />

                <asp:RegularExpressionValidator ID=rev runat=server ControlToValidate=txtEmail

                  ValidationExpression=\w+([+]\w+)*@\w+([]\w+)*\\w+([]\w+)* Text=* ErrorMessage=Please enter a valid email address />

              </td>

            </tr>

            <tr>

              <td>

                Membership Alias:</td>

              <td>

                <asp:TextBox ID=txtAlias runat=server />

                <asp:RequiredFieldValidator ID=RequiredFieldValidator runat=server ControlToValidate=txtAlias

                  Text=* ErrorMessage=You must enter a value for the membership alias />

              </td>

            </tr>

            <tr>

              <td>

                Theme:</td>

              <td>

                <asp:DropDownList ID=ThemeList runat=server>

                  <asp:ListItem Text=Default Value= />

                  <asp:ListItem Text=Wrox Red Value=WroxRed />

                  <asp:ListItem Text=Wrox Blue Value=WroxBlue />

                </asp:DropDownList>

              </td>

            </tr>

          </table>

          <br />

          <asp:ValidationSummary ID=vs runat=server DisplayMode=BulletList />

          <br />

          <asp:Button ID=btnSaveChanges runat=server OnClick=btnSaveChanges_Click Text=Save Changes />

          <asp:Button ID=btnCancelChanges runat=server OnClick=btnCancelChanges_Click

            CausesValidation=false Text=Cancel Changes />

        </ContentTemplate>

      </asp:RoleGroup>

   

    </RoleGroups>

  

  </asp:LoginView>

[]  []  []  []  []  []  


From:http://tw.wingwit.com/Article/program/net/201311/15701.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.