Working with ASP.NET Controls What is ASP.NET Using server controls in your pages Allowing users to create their own accounts Creating a login page Letting.

Slides:



Advertisements
Similar presentations
1 FrontPage 2000 Online Tutorial The following tutorial aims to help you get started with FrontPage 2000 for the creation of basic web pages. The different.
Advertisements

Creating Online Presentations. Creating a Presentation To create a presentation 1.Open PowerPoint. In the task pane under New select From Design Template,
Forms Authentication, Users, Roles, Membership Ventsislav Popov Crossroad Ltd.
XP Information Technology Center - KFUPM1 Microsoft Office FrontPage 2003 Creating a Web Site.
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview Introduce Visual Studio 2013 Create a first ASP.NET application.
1 of 6 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
File sharing. Connect the two win 7 systems with LAN card Open the network.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 21: Publishing Your Pages on the Web.
Access Tutorial 10 Automating Tasks with Macros
Chapter 7 Working with Files.
Visual Basic Chapter 1 Mr. Wangler.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Classroom User Training June 29, 2005 Presented by:
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Back to content Final Presentation Mr. Phay Sok Thea, class “2B”, group 3, Networking Topic: Mail Client “Outlook Express” *At the end of the presentation.
Forms Authentication, Users, Roles, Membership Svetlin Nakov Telerik Corporation
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
Tutorial 10 Adding Spry Elements and Database Functionality Dreamweaver CS3 Tutorial 101.
Chapter 13 – Advanced Topics Dr. Stephanos Mavromoustakos.
IT533 Lectures Security. Reasons for Security Prevent access to areas of your Web server Record and store secure relevant user data Security Configuration.
Creating Effective School and PTA Websites Sam Farnsworth Utah PTA Technology Specialist
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
Creating a Web Site to Gather Data and Conduct Research.
E-Commerce: Introduction to Web Development 1 Dr. Lawrence West, Management Dept., University of Central Florida Topics What is a Web.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
Internet Browsing the world. Browse Internet Course contents Overview: Browsing the world Lesson 1: Internet Explorer Lesson 2: Save a link for future.
Chapter 3: Using GUI Objects and the Visual Studio IDE.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 6 1 Microsoft Office FrontPage 2003 Tutorial 6 – Publishing a Web Site.
CSCI 6962: Server-side Design and Programming Introduction to Active Server Pages.
1.Getting Started 2.Modifying Design 3.Page 4.News 5.Events 6.Photo Gallery 7.Newsletter Index Training 15 th Mar., 2011.
MIS 3200 – C# (C Sharp)
Alice 2.0 Introductory Concepts and Techniques Project 1 Exploring Alice and Object-Oriented Programming.
C# Tutorial -1 ASP.NET Web Application with Visual Studio 2005.
1 of 8 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Microsoft Visual Basic 2005 CHAPTER 7 Creating Web Applications.
Introduction to ASP.NET T.Ahlam Algharasi. The Visual Studio IDE Start page 2.
Lesson 11: Looking at Files and Folders what a file or folder is on the computer how to recognize a file or folder on the desktop how to recognize the.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
ASP.NET The Clock Project. The ASP.NET Clock Project The ASP.NET Clock Project is the topic of Chapter 23. By completing the clock project, you will learn.
BIT 285: ( Web) Application Programming Lecture 18: Thursday, March 5, 2015 REST Creating a REST API Instructor: Craig Duckett.
Microsoft Access 2010 Chapter 10 Administering a Database System.
1 Part-1 Chap 5 Configuring Accounts Definitions.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 7 – Creating and Using Templates in a Web.
FrontPage Tutorial Part 2 Creating a Course Web Site.
MEMBERSHIP AND IDENTITY Active server pages (ASP.NET) 1 Chapter-4.
Creating a Dynamic Web Page Template Module 5: Beyond the Basics with Expression Web LESSON 10.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 8 – Integrating a Database with a FrontPage.
Double –Click on the Netscape Icon on your desktop The following are a series of steps to help you get started with Netscape Composer.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
XP New Perspectives on Microsoft Windows XP Tutorial 2 1 Microsoft Windows XP Working with Files Tutorial 2.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Microsoft FrontPage 2003 Illustrated Complete Creating a Frames Page.
Creating a Web Site Creating a new Web site Defining and using folders Creating and editing Web pages Viewing pages in a Web browser.
Easy Site Navigation Getting organized, staying organized Creating custom site-navigation controls Using Menu, TreeView, and SiteMenuPath controls Make.
Configuring a Membership Site Configure your Web site for membership Create folders for members-only content Prevent anonymous users from accessing members-only.
GETTING STARTED WITH VISUAL STUDIO.NET Getting Around Visual Studio.NET Using Panes Getting Panes back to normal The View Menu Online Resources Compatibility.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
CREATING MASTER PAGES Creating a Master Page Using Master Pages Giving your site a professional look and feel Adding Master Page content to existing pages.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Using Personalization Creating user profiles Retrieving, changing, and saving profile properties Using validation controls Using the Forms Designer.
Easy Access with templates I: Create a database Lesson 16 By the end of this lesson you will be able to complete the following: Find the best database.
Basic Computer Skills Windows & the Internet vfu.bg/en/e-Learning/
MIS 3200 – C# (C Sharp)
Security In your webSite.
Unit 7 Learning Objectives
Web Development in Microsoft Visual Studio 2013
Creating Online Presentations
Presentation transcript:

Working with ASP.NET Controls What is ASP.NET Using server controls in your pages Allowing users to create their own accounts Creating a login page Letting users change their passwords

What is ASP.NET? ASP.NET is essentially a set of controls for a building dynamic, data-driven Web site. Suppose you go to type in something. A moment later, Google sends back a page with links to a bunch of Web sites. Where did that page come from? How does that work? Google’s Web server had to take an active role in creating the page it sent to your Web browser. The pages that Google sends out from its Web server are dynamic in that each page contains only links that match the words the user searched for. Those results are datadriven in that all those links are stored in a database at Google’s site. Making your Web server take an active role in creating the pages it sends is what ASP.NET is all about

What is ASP.NET?- Continue You can’t send pages that contain server controls directly to clients. Clients can’t execute server controls. The server uses data from the database and information in the.aspx page to determine exactly what HTML is needed on the client PC. Then the server creates the appropriate page and sends it to the client.

What is ASP.NET?- Continue In Visual Web Developer, the Toolbox shows the names of commonly used.NET Server controls, categorized into groups like Data, Validation, Navigation, Login, and so forth. These tools are visible only when you’re editing a Web form (.aspx page). The server controls are hidden when you’re editing an.HTML page.

Adding a Server Control to a Page

Tweaking server controls in Design view In Design view, clicking an ASP.NET control selects the control. The Properties sheet shows the name and properties of the control. Play with the Auto- Format

Tweaking server controls in Source view Controls in the.NET Framework are organized into a hierarchical namespace, a place to keep them that works much the same way as the hierarchical organization of the folders on your hard disk that keep your files. In the Properties window, System.Web.UI.WebControls.Login is the full name of the Login control within the.NET Framework namespace. Go to TestMaster.cs

Tweaking server controls in Source view

Using the Common Tasks menu Using Auto Format Clicking that button takes you to an Auto Format dialog box, where you see a list of scheme names and a preview window. Choose Auto Format ➪ Classic scheme, and click OK. Converting a control to a template The Control is made of several smaller controls. How can I change one individual control? When you choose Convert to Template, a complex visual control like Login is divided into its individual components. Then, the “Convert to Template” option on the Common Tasks menu is replaced with a Reset option. Administering the Web site The Administer Website option on the Common Tasks menu is just a shortcut to the Web Site Administration Tool already discussed. No need to switch to that tool Editing templates (we will talk later)

ASP.NET Login Controls Pointer: Not really a Login control. Login: Presents a control that allows users to log into their accounts with their user name and password. LoginView: Lets you show different stuff to different users based on whether they’re anonymous or logged in. PasswordRecovery: As the name implies, presents fields that allow a user to recover a forgotten password. LoginStatus: Displays a Login link to anonymous users, or a Logout link to authenticated users. LoginName: Displays nothing to an anonymous user; displays an authenticated user’s login name. CreateUserWizard: Provides a fill-in-the-blanks form for creating a new user account. Use it in your Web sites to allow people to create their own accounts. ChangePassword: Provides a form that allows a user to change his or her password.

Allowing Users to Create an Account If your site will allow anyone to create an account, you need a page that allows users to enter the appropriate data. To do this use the CreateUserWizard control because it displays on a Web page all the fields needed for a user to create an account. To create a new page for the control, right-click the site folder or subfolder in Solution Explorer and choose Add New Item (CreateAcct.aspx). Drag a CreateUserWizard tool from the Login category of the Toolbox onto the page

Assigning new users to a role The CreateUserWizard control doesn’t automatically assign a new user to a role. If you want to put all the people who sign up through the CreateUserWizard control into a specific role, add a little code: In design view, select the CreateUserWizard control. Its name appears in the Properties sheet when selected. In the Properties sheet, click the Events (lightning bolt) button. Double-click the CreatedUser event. You’re taken to the code-behind page for the page you’re designing; The cursor is already in the event procedure, right where you type its code. Type the following at the cursor position, substituting your own data for the italics, as follows: Roles.AddUserToRole(ctrlName.UserName,”roleName”);

Few CreateUserWizard tips A couple of noteworthy properties include ContinueDestinationPageURL and LoginCreatedUser. You can set the ContinueDestinationPageURL property to whatever page you want to have open when the user clicks Continue after successfully creating an account. The LoginCreatedUser property determines whether or not the user is logged in automatically after creating the account. The default is True, the user is logged in.

Testing the control Run the page and test the creation of a new account. Remember At least 7-chars long passwords At least 1 non-alphanumeric char To verify that the process worked, you can choose Website ➪ ASP.NET Configuration from the menu bar to open the Web Site Administration Tool. Click the Security tab, and then Click Manage Users. The new user should be listed.

Providing a Login Link To make your site easy to use, you need a login link on every page. An easy way to provide this is to put a link to the Login.aspx page into the Master Page for your site. But a regular link that always showed Login would be confusing for people who have already logged in. The link should show Logout or something else for people who are already logged in. That’s where the LoginStatus control comes in. You must create a page named Login.aspx in your site’s root folder before you can actually use the controls described in this EXAMPLE. Otherwise, when you try to test the control in a Web browser, you’ll get an error message indicating that the Login.aspx page cannot be found.

The LoginStatus contr Drag a LoginStatus control to a Master Page Close and save the Master Page Then, right-click any page that uses the Master Page and choose View in Browser. In the browser, clicking the Login link should take you to Login.aspx. If your Default.aspx page uses the Master Page, you’ll see that the link has changed from Login to Logout, because you’re logged in.

The LoginName control This control shows nothing to anonymous users. For authenticated users, the control displays the user’s login name. Typically you use the LoginName control with the LoginView control.

The LoginView control The LoginView control can tell the difference between anonymous and authenticated users. But it’s not limited to showing text or a picture. You can use it to show just about anything, even ASP.NET server controls. To use the control, just drag it to the Web page or Master page. The control is shaped as a box. The box has two different views, but you only see one view at a time. Choose one of: Anonymous Template: Content that anonymous users see. LoggedIn Template: Content that only authenticated users see.