ASP.NET英文文献及翻译
Get Personal with ASP.NET Whidbey
G. Andrew Duthie
Graymad Enterprises Inc.
October 2003
Applies to:
Microsoft? ASP.NET Whidbey
Microsoft Visual Basic? .NET
Summary: Learn how to reduce development time and how to code with personalization and membership in the upcoming version of ASP.NET, code name ASP.NET "Whidbey" (after the code name for the upcoming release of Microsoft? Visual Studio? .NET).
Configure the Provider原文请找腾讯752018766优,文^论~文.网http://www.youerw.com
With both personalization and membership, the first step is configuring the provider that you will use to store the personalization or membership data. Though you can create the Microsoft Access or Microsoft SQL Server? database and add the necessary configuration elements manually, the easier way is to use the ASP.NET Web Site Administration tool, shown in Figure 1. Note that to configure an application successfully, you must be logged in using an account with administrator rights (you also can launch Microsoft Visual Studio? .NET with an administrator-level account using Run As... and launch the Web Site Administration tool from the button in Solution Explorer).
The ASP.NET Web Site Administration tool provides the means to configure personalization and membership features (the Membership data store is configured using the Security tab), as well as reports and data-access features.
To create an Access .mdb file for storing personalization data, you need to open the Web Site Administration tool; the file, named AspNetDB.mdb, will be created automatically in a folder named DATA. Although not enabled in the build of Visual Studio against which this article was written, the Web Site Administration
Now, will found the member status database, and increases the essential disposition element to the web.config document. Here you need to do are only (you may use Web stand management tool or member status API to the database increase user complete), according to need to establish the authorization on the page to limit as well as to found register the page.
Please note, has custom-made the database structure which for the personalization founds with the member status is the same, therefore may (consider efficiency, you should) have custom-made same as the member status use to the personalization provide the procedure, this point are very important. That is, if wants, you may have custom-made the use to the personalization differently to provide the procedure with the member status, vice versa.
Provide the procedure except built-in Access and SQL Server, you may also found your provide the procedure from the definition, and disposes your application procedure to use these to provide the procedure. Therefore, if you already had the user proof database, and does not want to give up, ASP.NET may allow you to use this database and simultaneously to enjoy the advantage which the member status service provides. Please note, when composes this article files, will found provides the procedure from the definition the actual method possibly also to experience some changes, therefore I will preserve a foundation for future article will provide the procedure from the definition the demonstration.
How does the data is save?
How uses Server the Explorer examination data to save in AspNetDB.mdb. Only need found one to the AspNetDB.mdb database connection, and drives the table from the connection to your stand page. Visual Studio will found GridView to control, and binds it to AccessDataSource controls (please to note, must make it to work, the ASP.NET auxiliary advancement must to contain database folder to have read-write jurisdiction). If you in time browsing application procedure page has the difficulty, please before glancing over the page closes the connection in Server Explorer.
This guide scope
Had the enough theory basis, lets us watch a demonstration immediately. I will guide you to dispose the personalization to have custom-made with the member status use Access to provide the procedure; To member status database increase user; The increase personalization has custom-made the attribute; And uses in page's on these attributes the anonymous user and has registered the user. starts your Visual the Studio transcription, and founds a new Web stand. After founding the stand and writes down this stand IDE, single-clicks in Solution Explorer window Web Site
Administration tool button
Then, single-clicks the Security option card, guaranteed that selects Security Setup Wizard to choose the button only, and single-clicks Next. First step only displayed information, therefore after reading, please single-click Next (possibly to need to roll can see button). In the second step, guaranteed that selects From the Internet to choose the button only, then single-clicks Next. Please note, “From the Internet” the establishment will dispose the application procedure to use the ASP.NET window identification authentication, “From a 1655