After the control (Web hosting directory) is placed on the page,

After the control is placed on the page, the control is shaped as a box. The box has two different views, but you only see one view at a time. You can choose which view you want to see (and design) by choosing one of the following from the View option on the LoginView control s Common Tasks menu: Anonymous Template: Content that anonymous users see. LoggedIn Template: Content that only authenticated users see. What you put into either template is entirely up to you. It can be text, a table, a picture, an ASP.NET control, whatever. Think of the box as a mini-page that can contain anything that a big page can contain. During this stage of the site-building project, your best bet would be to create a simple LoginView control that shows a Login link to anonymous users. For authenticated users, the control shows the user s name and a Logout link. This comes in very handy when you re testing your site, because you can always see whether you re currently testing as an anonymous user or as an authenticated user. Putting the control on a Master Page is especially helpful because you ll be able to see it on every page that uses the Master. So, given that general advice, let s take a look at the steps required to make it happen: 1. In Solution Explorer, double-click your Master Page to open it in Design view. In Chapter 4, I created a MasterPage.master file in a folder named Masters. So I ll use that one as a working example here. 2. Drag a LoginView control from the Login category of the Toolbox to the top (or left) pane of the Master Page so that it will be visible on all pages that use the master. By default, the control will be named LoginView1. 3. From the control s Common Tasks menu, choose Anonymous Template. Whatever you add to the LoginView control now will be visible only to anonymous users. 4. Drag a LoginStatus control from the Toolbox into the LoginView1 control. The LoginStatus control appears as a Login link, and its Common Tasks menu might open automatically. You don t need to change anything on the LoginStatus control, so just click the larger LoginView1 control to hide that Common Tasks menu. Chapter 7: Working with ASP.NET Controls 139
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check Vision professional web hosting services

Leave a Reply