asp.net 2.0 site login, navigation and rights management

Source: Internet
Author: User

(i) Login

In ASP.net 2.0, many new features and controls have been added. Among them, the new landing controls make Web applications design more handy. What is a login control? Is that we usually use in the Web application of the user registration, login, forget the password, after landing according to the different rights and display different pages, and so on, now in ASP.net 2.0 can be implemented by the control provided.

In ASP.net 2.0, a new framework membership is introduced to make it easier to create and manage users, as well as password-protect pages in WEB applications. The new framework contains additional features to handle authentication and authorization that can meet the needs of both Web site administrators and developers. Web site administrators can leverage new Web site Administration tools to create new users and roles, and control access to pages in Web applications. The Web Site Administration tool is a set of predefined ASP. NET pages, users who do not have programming skills can use them to configure WEB applications. Using the membership API, programmers can easily use the drag control method, and then a small number of code, you can fully implement the user, role permissions, and so on, can also be customized to expand.

1. Create a website project

2.ASP. NET Configuration

Security settings options are divided into three parts: users, roles, and rules.

Logon authentication can be configured to be based on forms and windows.

3. Using the Login control

Description: After the user log in, display the "Exit" prompts, through the LoginStatus control to achieve. In the control's properties, there are logoutaction and logoutpageurl two properties that can be used to set the logout to simply refresh the current page, move to a page, or turn to the login page.

How to set Loginpageurl (Login page), when running the program, when you press the login link displayed by this control, always go to the login.aspx under the root folder, and the actual login file is/login/login.aspx. How to solve?

Check the data, the original login URL is set in the web.config. If you are using form to authenticate the login, the default web.config is written like this:

<system.web>
  <authentication mode="Forms" />
</system.web>

needs to be modified as follows:

<system.web>
  <authentication mode="Forms">
<forms loginUrl="~/member/login.aspx"></forms>
  </authentication>
</system.web>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.