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

ASP.NET入門教程 11.2 Wrox United中角色的介紹[3]

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

    ()保持在Source View中並且輸入如下的代碼行這將確保無論是誰訪問該站點都可以顯示一些可視的內容

 

<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 most of which

            you already know from the email we regularly send out One that hasnt made it to

            the email yet is the proposed end of season BBQ a great excuse for a summer party

            (not that we really need an excuse) This will be open to all members of the public

            and tickets will be heavily discounted for fan club members as a thank you for all

            of the great support youve given the club The date hasnt yet been 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>

      <asp:RoleGroup Roles=AdministratorOwnerManagerReporter>

        <ContentTemplate>

          To see the Fan Club features you need to be a member As special users you get free

          entry to the fan club talk to the admin people to get set up

        </ContentTemplate>

      </asp:RoleGroup>

    </RoleGroups>

    <AnonymousTemplate>

      <p>

        The fan club provides a way for you to show your devotion to the club and gains

        you exclusive privileges You get discounts on match tickets and at the club store

        as well as having the opportunity to meet up with like minded fans

      </p>

      <p>

        Membership to the Fan Club can be bought from the <a href=Shopaspx>Club Shop</a>

        Once membership has been received well enable your account as a Fan Club Member

      </p>

    </AnonymousTemplate>

  </asp:LoginView>

[]  []  []  []  []  


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