Building ASP.NET Applications 2 Lecture 3,4 T. Ahlam Algharasi 4 th Level.

Slides:



Advertisements
Similar presentations
Chapter 3 – Web Design Tables & Page Layout
Advertisements

WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Creating a Login Process Creating a users table and a login form that denies access to unauthorized users.
Forms Authentication, Users, Roles, Membership Ventsislav Popov Crossroad Ltd.
Creating Custom Reports. 2 Design and create a custom report You can easily create custom reports based on a table or query. There are seven sections.
1 Configuring Internet- related services (April 22, 2015) © Abdou Illia, Spring 2015.
User Controls, Master Pages, GridView. Content User Controls Styles, Themes, Master Pages Working with Data GridView Muzaffer DOĞAN - Anadolu University2.
Chapter 9 Customizing Data with Web Controls. ASP.NET 2.0, Third Edition2.
Authenticating Users in an ASP.NET Application. Web Site Administration Tool From VS 2008, click Website/ ASP.Net Configuration to open Web Site Administration.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 3-1 of…
ASP.NET 2.0 Chapter 6 Securing the ASP.NET Application.
6 th Annual Focus Users’ Conference Application Editor and Form Builder Presented by: Mike Morris.
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
Branded Websites. Branded Website Training Click the “Edit Pencil” to edit the website Enter in your iBoomerang username and password.
Chapter 8 Binding Data to Web Controls. ASP.NET 2.0, Third Edition2.
Session 11: Security with ASP.NET
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
Chapter 10 Managing Data with ASP.NET. ASP.NET 2.0, Third Edition2.
Forms Authentication, Users, Roles, Membership Svetlin Nakov Telerik Corporation
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
IT533 Lectures Security. Reasons for Security Prevent access to areas of your Web server Record and store secure relevant user data Security Configuration.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Chapter 71 Building Data-Driven ASP.NET Applications Introduction to ASP.NET By Kathleen Kalata.
Copyright 2000 eMation SECURITY - Controlling Data Access with
Creating a Web Site to Gather Data and Conduct Research.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Securing a Microsoft ASP.NET Web Application.
1 Data Bound Controls II Chapter Objectives You will be able to Use a Data Source control to get data from a SQL database and make it available.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
1 CS 3870/CS 5870: Note 11 Authentication and Authorization Membership Provider.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
Meeting #6 – April 2011 – Web-Technologies Homework Assignments Svetlin Nakov Telerik Corporation
Delivering Excellence in Software Engineering ® EPAM Systems. All rights reserved. Data Binding in ASP.NET.
Dr. Mustafa Cem Kasapbaşı Security in ASP.NET. Determining Security Requirements Restricted File Types.
Introduction to ASP.NET T.Ahlam Algharasi. The Visual Studio IDE Start page 2.
CSCI 6962: Server-side Design and Programming Database Manipulation in ASP.
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.
PROG Advanced Web Applications With.NET PROG Advanced Web Applications With.NET User Authentication & Authorization.
Chapter 8 Working With Databases in ASP.NET. Listing 8.1 – ShowListControls Uses The SqlDataSource control for estabishing database connectivity and.
1 CS 3870/CS 5870: Note 07 Lab 3 Lab 4 Test 1: Two Tables.
Module 11: Securing a Microsoft ASP.NET Web Application.
Slide 1 ASP Authentication There are basically three authentication modes Windows Passport Forms There are others through WCF You choose an authentication.
Microsoft Access 2010 Chapter 10 Administering a Database System.
Course ILT Forms and queries Unit objectives Create forms by using AutoForm and the Form Wizard, and add or modify form headers and footers Open and enter.
What is Web Site Administration Tool ? WAT Allow you to Configure Web Site With Simple Interface –Manage Users –Manage Roles –Manage Access Rules.
TRAINING SESSIONS.NET Controls.  Standard Controls  Label  Textbox  Checkbox  Button, Image Button, Image control  Radio Button  Literal  Hyperlink.
Reference: “ASP.NET 2.0 Illustrated” by Alex Homer and Dave Sussman. -ch3 illustrated book
MEMBERSHIP AND IDENTITY Active server pages (ASP.NET) 1 Chapter-4.
CSE 409 – Advanced Internet Technology Today you will learn  Styles  Themes  Master Pages Themes and Master Pages.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 8 – Integrating a Database with a FrontPage.
January 2006Colby College ITS Setting Up Course Pages.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Bookstore Web Application: Client Tier Introducing Web Controls.
Configuring and Deploying Web Applications Lesson 7.
Web Site Development - Process of planning and creating a website.
1 CS 3870/CS 5870: Note07 Prog 4. Master Pages Creating a master page based on another master page MainMasterPage –For all Progs and Tests Prog4MasterPage.
1 CS 3870/CS 5870: Note07 Prog 4. Master Pages Creating a master page based on another master page MainMasterPage –For all Progs and Tests Prog4MasterPage.
Unit 8.2 Learning Objectives Data Warehouses – The Role of Data Warehouses The Role of Data Warehouses – Group Exercise Accessing Data in Views – Accessing.
Module 10: Data Access in ASP.NET. Overview Overview of the ASP.NET Data Access What is Data Access List of Data Source Control What is Data Bound How.
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.
Business Objects XIr2 Windows NT Authentication Single Sign-on 18 August 2006.
Security In your webSite.
Unit 7 Learning Objectives
CONTENT MANAGEMENT SYSTEM CSIR-NISCAIR, New Delhi
CONTENT MANAGEMENT SYSTEM CSIR-NISCAIR, New Delhi
Microsoft Office Access 2003
Created by : Asst. Prof. Ashish Shah
Configuring Internet-related services
Building ASP.NET Applications
Web Development Using ASP .NET
(Includes setup) FAQ ON DOCUMENTS (Includes setup)
Presentation transcript:

Building ASP.NET Applications 2 Lecture 3,4 T. Ahlam Algharasi 4 th Level

GridView Control Custom Formatting with TemplateField 05.2 T.Ahlam Algharasi

GridView Control 1. Bind Data from a table to Gridview Control. 2. Delete all selected fields from Fields Dialog. 3. Add Template Field to the Gridview control 3 T.Ahlam Algharasi

GridView Control 4. Edit Template > item Template 5. Design the layout 4 T.Ahlam Algharasi

GridView Control 6. Bind data to controls To bind date to Label control 5 Eval(“FieldName”) Ex : Eval(“title”) T.Ahlam Algharasi

GridView Control To bind date to image control use ImageUrl properties To bind date to hyperlink control use NavigateUrl properties To link to an image To link to a page (and sending record id via url) 6 “Foldername/” & Eval(“FieldName”) Ex : “product/” & Eval(“Image”) “Foldername/” & Eval(“FieldName”) Ex : “product/” & Eval(“Image”) “Pagename?no=” & Eval(“Id_field”) Ex : “details.aspx?no=” & Eval(“ID”) T.Ahlam Algharasi

GridView Control GridView Template Editing HeaderTemplate 7 T.Ahlam Algharasi

Demo Example 1 Master-Details using GridView control (Separate Pages) 8 product.aspx details.aspx When a user click on “more” the details of the selected record will open on details page

Demo product.aspx In product.aspx page Bind Data to the Gridview Control Add A hyperlinkField Set DataNavigateUrlFields, DataNavigateUrlFormate properties 9 T.Ahlam Algharasi

Demo details.aspx In details.aspx page 1.Configure the Data Source and add where clause 10 Then Click Add T.Ahlam Algharasi

Demo details.aspx In details.aspx page 2. Design a specific template 11 T.Ahlam Algharasi

DetailsView Control Displays the contents as a single record at a time. It can insert, update and delete the record also. 12 T.Ahlam Algharasi

DetailsView Control Master/Detail ( GridView and DetailsView) Ex1 : Display records from two tables 13 Book category Table Book category Table Book Details Table Book Details Table T.Ahlam Algharasi

DetailsView Control 1. Bind Data from Category table to Gridview Control 2. Bind Data from Book table to DetailsView Control and specifies where clause 14 T.Ahlam Algharasi

DetailsView Control Master/Detail ( GridView and DetailsView) Ex2 : Display records from one table 15 Book Details Table Book Details Table Record Detail T.Ahlam Algharasi

DetailsView Control 1. Bind Data from Book table to Gridview Control 2. Bind Data from Book table to DetailsView Control and specifies where clause 16 T.Ahlam Algharasi

DetailsView Control Master-Details GridView and DetailsView (Separate Pages) 17 details.aspx product.aspx T.Ahlam Algharasi

DetailsView Control In product.aspx Page Add A HyperLinkField Set DataNavigateUrlFields, DataNavigateUrlFormate properties 18 T.Ahlam Algharasi

DetailsView Control In details.aspx Page 19 T.Ahlam Algharasi

DataList Control Displays fields from a data source within table cell which can be repeated horizontally across the page or vertically down the page. The content and layout of list items in DataList is defined using templates. 20 T.Ahlam Algharasi

DataList Control One of the main advantage of DataList control is it supports directional rendering (Horizontal/Vertical) 21 Horizontal Vertical T.Ahlam Algharasi

DataList Control 22 DescriptionProperties horizontally or vertically RepeatDirection number of "columns" RepeatColumns DescriptionTemplate Name Template to define how separator between items SeparatorTemplate determines the content and layout of the list header. HeaderTemplate determines the content and layout of the list footer. FooterTemplate T.Ahlam Algharasi

Demo Example In The First page Display the category with Datalist Control 23 T.Ahlam Algharasi

Demo In The Second page Display the books with Gridview Control 24 T.Ahlam Algharasi

Demo In The Second page To Bind Data from data source depending on value of category id do the following 25 By Catid to display all product of thee selected category T.Ahlam Algharasi

Demo In The Second page Design a specific template 26 T.Ahlam Algharasi

Form view Control FormView control Displays the values of a single record from a data sourse using user-defined templates Allows you to edit, delete, and insert record. You can also add validation controls while inserting or updating 27 T.Ahlam Algharasi

Form view Control Templates of the FormView Control EditItemTemplate The template that is used when a record is being edited. InsertItemTemplate The template that is used when a record is being created. ItemTemplate The template that is used to render the record to display only. Note: The major difference between DetailsView and FormView is, here user need to define the rendering template for each item. 28 T.Ahlam Algharasi

Difference between ASP.NET Data Controls 29 Multiple Item Display GridView T.Ahlam Algharasi

Difference between ASP.NET Data Controls 30 Multiple Item Display DataList T.Ahlam Algharasi

Difference between ASP.NET Data Controls Single Item Display DetailsView 31 T.Ahlam Algharasi

Difference between ASP.NET Data Controls 32 Single Item Display FormView T.Ahlam Algharasi

Security is one of the most important component of any application. Security

Using Authentication in ASP.NET Authentication is a process of determining how you will verify a client’s identity when the client requests a page. Authorization is the process of determining which clients have access to the resources within the web application or current directory. 34 T.Ahlam Algharasi

Using Authentication in ASP.NET Requesting a web page that requires authentication 35 T.Ahlam Algharasi

Using Authentication in ASP.NET Authentication is implemented through one of four possible authentication systems: Windows authentication Forms authentication Passport authentication No authentication 36 T.Ahlam Algharasi

Using Authentication in ASP.NET 1. Windows Authentication The Windows authentication allows us to use the windows user accounts. Windows authentication in ASP.NET actually relies on IIS to do the authentication. IIS can be configured so that only users on a Windows domain can log in. If a user attempts to access a page and is not authenticated, they'll be shown a dialog box asking them to enter their username and password. 37 T.Ahlam Algharasi

Using Authentication in ASP.NET 2. Passport Authentication Passport Authentication provider uses Microsoft's Passport service to authenticate users. You need to purchase this service in order to use it. 38 T.Ahlam Algharasi

Using Authentication in ASP.NET Form Authentication Forms Authentication uses HTML forms to collect the user information and than it takes required actions on those HTML collected values. The advantage of using this type of authentication It allows you to decide how to store user information. (storing username and password in the Web.Config file, an XML file, or a database table.) 39 T.Ahlam Algharasi

Using Authentication in ASP.NET Enabling Form Authentication To enable basic Forms authentication for an application, the follow three steps are to be followed: Set the authentication mode for the application by modifying the authentication ­section in the application root Web.Config file. Deny access to anonymous users in one or more directories in the application by modifying the authorization section in the Web.Config files in the appropriate directories. Create a login page containing a form that enables users to enter their usernames and passwords. 40 T.Ahlam Algharasi

Using Authentication in ASP.NET To perform Form Authentication Secure pages in a separate subfolder Create a web.config file inside the subfolder 41 Create web configuration file in the folder you want to secure it Create web configuration file in the root directory. T.Ahlam Algharasi

Using Authentication in ASP.NET Web.Config File Web.config file (Web configuration file) it keeps the configurations required for the web application. There are number of important settings that can be stored in the configuration file. Database connections Session States Error Handling Security 42 T.Ahlam Algharasi

Using Authentication in ASP.NET Forms Authentication Configuration 1. Configure Forms Authentication in Web.Config. 43 <forms loginUrl="~/login.aspx“ defaultUrl="~/adminpages/welcome.aspx” /> T.Ahlam Algharasi

Using Authentication in ASP.NET Forms Authentication Configuration 44 Description Property Indicates the URL that users are redirected to after signing in from the login page if there is no RedirectUrl value the default value is default.aspx. defaultUrl The URL of the login page. The default value is login.aspx. loginUrl T.Ahlam Algharasi

Using Authentication in ASP.NET Authorization Configuration Configure Authorization in Web.Config (Subfolder). Use an element to ensure that only authenticated users can access secure pages. 45 T.Ahlam Algharasi

Using Authentication in ASP.NET Permissible elements for authorization are Allow Deny. Each allow or deny element must contain a users attribute. 46 DescriptionUserName All users * Anonymous (unauthenticated) users ? T.Ahlam Algharasi

Using Authentication in ASP.NET Creating the Login Page The ASP.NET login controls provide a robust login solution for ASP.NET Web applications without requiring programming. By default, login controls integrate with ASP.NET forms authentication to help automate user authentication for a Web site. 47 T.Ahlam Algharasi

Using Authentication in ASP.NET Login Page Control properties 48 DescriptionProperty Indicates the text to be displayed in the heading of the control. TitleText Indicates the label text of the username text box. UserNameLabelText Indicates the label text of the password text box. PasswordLabelText Indicates the text that is displayed after failure of login attempt. FailureText Indicates the initial value in the username text box. UserName Indicates the text of the Login button. LoginButtonText true/false. Indicates whether to show Remember Me checkbox or not. DisplayRememberMe T.Ahlam Algharasi

Using Authentication in ASP.NET Login Page Control Styles 49 DescriptionProperty Indicates the style property of the Remember Me checkbox. CheckBoxStyle Indicates the style property of the failure text. FailureStyle Indicates the style property of the title text. TitleTextStyle Indicates the style property of the Login button. LoginButtonStyle Indicates the style property of the TextBox. TextBoxStyle Indicates the style property of the labels of text box. LabelStyle T.Ahlam Algharasi

Using Authentication in ASP.NET Login code 50 T.Ahlam Algharasi

Using Authentication in ASP.NET Login code 51 T.Ahlam Algharasi

Using Authentication in ASP.NET RedirectFromLoginPage(). Method It is called after a successful Forms Authentication login to redirect to the URL in the DefaultUrl property which is in the Web.config file.DefaultUrl If the second parameter is true it creates an authentication cookie, otherwise it doesn’t create a cookie 52 <forms loginUrl="~/login.aspx“ defaultUrl="~/adminpages/welcome.aspx" />

Using Authentication in ASP.NET RemeberMeSet if "Remember Me" is checked, it stores the UserName in a cookie. if the "Remember Me" CheckBox is UNchecked, it will *delete* the cookie that remembers the UserName. 53 T.Ahlam Algharasi

Questions