Logging In | in .NET

Creating QR in .NET Logging In |

Logging In |
QR Printer In .NET Framework
Using Barcode generation for ASP.NET Control to generate, create QR Code JIS X 0510 image in ASP.NET applications.
www.OnBarcode.com
Making 2D Barcode In VS .NET
Using Barcode encoder for ASP.NET Control to generate, create Matrix Barcode image in ASP.NET applications.
www.OnBarcode.com
First screen
Barcode Generation In Visual Studio .NET
Using Barcode creation for ASP.NET Control to generate, create Barcode image in ASP.NET applications.
www.OnBarcode.com
PDF-417 2d Barcode Encoder In .NET
Using Barcode maker for ASP.NET Control to generate, create PDF-417 2d barcode image in ASP.NET applications.
www.OnBarcode.com
Second screen
Print Data Matrix 2d Barcode In Visual Studio .NET
Using Barcode drawer for ASP.NET Control to generate, create DataMatrix image in ASP.NET applications.
www.OnBarcode.com
Making EAN / UCC - 13 In .NET Framework
Using Barcode creation for ASP.NET Control to generate, create USS-128 image in ASP.NET applications.
www.OnBarcode.com
Third screen
UPC - 13 Generation In VS .NET
Using Barcode creation for ASP.NET Control to generate, create EAN-13 Supplement 5 image in ASP.NET applications.
www.OnBarcode.com
2 Of 5 Interleaved Generation In .NET
Using Barcode creator for ASP.NET Control to generate, create 2/5 Interleaved image in ASP.NET applications.
www.OnBarcode.com
Click on the Login link to get the Login page, shown as the second screen in Figure 10-4. Entering the username and password for one of the user accounts you created earlier in this chapter. After you click on the Log In button, you will be brought back to the Home page, shown as the third screen in Figure 10-4. Earlier, you enabled roles in the WAT and added each user to one of the three roles: Manager, Customer, and Employee. As you saw in 9, you can use these roles to present customized content to the users who visit the page. You ll add two Panel controls to the Home page that present content depending on the user s role. Edit Home.aspx to see this in action. Add two Panel controls, as listed in Example 10-5, to the page, inside the Content control, after the closing <div> for the text that all users see.
QR Code ISO/IEC18004 Reader In Java
Using Barcode decoder for Java Control to read, scan read, scan image in Java applications.
www.OnBarcode.com
QR Code Printer In None
Using Barcode generator for Microsoft Excel Control to generate, create QR Code ISO/IEC18004 image in Office Excel applications.
www.OnBarcode.com
<asp:Panel ID="pnlEmployee" runat="server" Visible="false" > <h3>Employee Information</h3> <div class="TextNormal"> This panel should only be visible to users are a members of the <b>Employee</b> role. Turning on the visibility of this Panel occurs in the Page_Load event handler.
Generating Data Matrix In Visual Basic .NET
Using Barcode encoder for .NET framework Control to generate, create Data Matrix image in Visual Studio .NET applications.
www.OnBarcode.com
UPC-A Supplement 5 Reader In VB.NET
Using Barcode reader for .NET Control to read, scan read, scan image in .NET applications.
www.OnBarcode.com
|
Making European Article Number 13 In VB.NET
Using Barcode encoder for Visual Studio .NET Control to generate, create EAN-13 Supplement 5 image in Visual Studio .NET applications.
www.OnBarcode.com
Barcode Scanner In VB.NET
Using Barcode Control SDK for .NET framework Control to generate, create, read, scan barcode image in .NET applications.
www.OnBarcode.com
10: Putting It All Together
Creating EAN-13 Supplement 5 In .NET Framework
Using Barcode printer for Reporting Service Control to generate, create EAN13 image in Reporting Service applications.
www.OnBarcode.com
Code 128 Code Set A Generator In VS .NET
Using Barcode creator for Visual Studio .NET Control to generate, create Code 128C image in Visual Studio .NET applications.
www.OnBarcode.com
</div> </asp:Panel> <asp:Panel ID="pnlManager" runat="server" Visible="false" > <h3>Manager Information</h3> <div class="TextNormal"> This panel should only be visible to users are a members of the <b>Manager</b> role. Turning on the visibility of this Panel occurs in the Page_Load event handler. </div> </asp:Panel>
UPC-A Supplement 2 Reader In Visual C#.NET
Using Barcode decoder for VS .NET Control to read, scan read, scan image in Visual Studio .NET applications.
www.OnBarcode.com
Data Matrix Encoder In None
Using Barcode generation for Office Word Control to generate, create Data Matrix ECC200 image in Word applications.
www.OnBarcode.com
Switch over to the code-behind for the Home page, Home.aspx.vb. Add the highlighted lines of code from Example 10-6 to the Page_Load event handler.
Generate Code-128 In Java
Using Barcode maker for Java Control to generate, create Code 128A image in Java applications.
www.OnBarcode.com
Encoding QR Code In None
Using Barcode printer for Font Control to generate, create QR Code image in Font applications.
www.OnBarcode.com
Protected Sub Page_Load(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles Me.Load Me.Master.PageSubTitle.Text = "Home" ' control the visibility of sections restricted to specific roles pnlManager.Visible = User.IsInRole("Manager") pnlEmployee.Visible = User.IsInRole("Employee") End Sub
The code here is very simple; it sets the visibility of each panel depending on the value of the IsInRole method for the appropriate role. Before logging in, the Home page will still look like the first screen in Figure 10-4. If you log in as rhampster, who is a member of the Managers role (it s only fitting that the boss is a rodent), you will see Figure 10-5. Now, log out and log in as user dhurwitz, and you ll see just the content of pnlEmployee. Log in again as user jliberty, and you won t see either panel because customers don t need to see employee-specific information. Of course, if you make a user a member of both the Manager and Employee roles, she would see both panels.
Navigation
The front page of your site is looking pretty good. Users can identify themselves, and see the custom content. The master page is working as planned, and each page identifies itself appropriately. The next thing to do is add some navigation tools so that users can find their way around, which means you have to create a site map. Close the browser if it is open, and select Website Add New Item, and choose Site Map. Accept the default name of Web.sitemap. As you learned in 6, the site map is an XML file, and you have to create it manually the IDE won t do it for you. Open the web.sitemap file, and replace the default boilerplate with the highlighted code in Example 10-7.
< xml version="1.0" encoding="utf-8" > <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > <siteMapNode title="Root" > <siteMapNode url="~/Home.aspx" title="Home" description="Home page" /> <siteMapNode url="~/Products.aspx" title="Products" description="Products offered by AdventureWorks" /> <siteMapNode url="~/Cart.aspx" title="Shopping Cart" description="Items selected for purchase" /> <siteMapNode url="~/Purchase.aspx" title="Purchase" description="Purchase your selected items" /> </siteMapNode> </siteMap>
Now that you have the site map file, you ll add the navigation controls to the master page. Add the following code to MasterPage.master, in the same table cell and after the LoginView control:
<hr /> <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="false" /> <asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1" CssClass="MenuText" />
|
Copyright © OnBarcode.com . All rights reserved.