Web Controls Chapter-7. Page  2 Synopsis  Stepping Up to Web controls  Basic Web control classes  Web control classes  Web control Base class  Units,

Slides:



Advertisements
Similar presentations
Tutorial 6 Creating a Web Form
Advertisements

JavaScript Forms Form Validation Cookies. What JavaScript can do  Control document appearance and content  Control the browser  Interact with user.
IT533 Lecture ASP.NET Controls. Installations Microsoft® SQL Server® 2008 Express.
Asp.NET Core Server Controls. Slide 2 Lecture Overview Understanding the types of ASP.NET controls HTML controls ASP.NET (Web) controls.
ASP.NET Data Binding. Slide 2 Lecture Overview Understanding the ASP.NET data binding model.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 1.1 of…
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 3-1 of…
Introduction to ASP.Net ISYS 350. ASP.NET ASP.NET is a server-side technology for creating dynamic web pages. ASP.NET allows you to use a selection of.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
ASP.NET Programming with C# and SQL Server First Edition
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
CST JavaScript Validating Form Data with JavaScript.
Overview This presentation covers the initial overview of the different server controls. 2.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
Forms and Form Controls Chapter What is a Form?
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
Chapter 3 Using Validation Controls. What is a Validation Control? A control that validates the value in another control Renders as an HTML tag with an.
1 Presented by Bikash Shrestha. 2 What is ASP.NET or ASP+? ASP.NET/ASP+ is a programming framework built on the common language runtime that can be used.
Dr. Azeddine Chikh IS444: Modern tools for applications development.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
Christopher M. Pascucci.NET Programming: Forms & Controls.
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
ASP.Net Web Applications. Characteristics of a typical data driven web application Web Server HTML Graphics Active-X Java Applets HTTP Request ADO / JDBC.
Chapter 71 Building Data-Driven ASP.NET Applications Introduction to ASP.NET By Kathleen Kalata.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 4-1 of…
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
SERVER web page repository WEB PAGE instructions stores information and instructions BROWSER retrieves web page and follows instructions Server Web Server.
ASP.Net, Web Forms and Web Controls 1 Outline Web Controls Text and Graphics Controls AdRotator Control Validation Controls.
Web Server Controls MacDonald Ch. 5 MIS 324 MIS 324 Professor Sandvig Professor Sandvig.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
ASP.NET Web Server Controls Basic Web Server Controls.
© Minder Chen, ASP.NET 2.0: Introduction - 1 ASP.NET 2.0 Minder Chen, Ph.D. Framework Base Class Library ADO.NET: Data & XML.
Chapter 4 – Working with ASP.NET Controls Dr. Stephanos Mavromoustakos.
ASP.NET Controls. Slide 2 Lecture Overview Identify the types of controls supported by ASP.NET and the differences between them.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
© 2010 Delmar, Cengage Learning Chapter 8 Collecting Data with Forms.
Microsoft Visual Basic 2005 CHAPTER 7 Creating Web Applications.
CSCI 6962: Server-side Design and Programming AJAX Tools in JSF and ASP.
Chapter 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
HTML Forms.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
 Types of Server Controls,  HTML Server Controls,  Web Controls,  List Controls,  Input Validation Controls,  Rich Controls.
Things like Textboxes, Lables, ‘n’at. ASPX page is not HTML Controls are rendered into markup that a browser can understand Some controls are rendered.
Module 4: Creating a Microsoft ASP.NET Web Form. Overview Creating Web Forms Using Server Controls.
HTML Form Widgets. Review: HTML Forms HTML forms are used to create web pages that accept user input Forms allow the user to communicate information back.
Reference: “ASP.NET 2.0 Illustrated” by Alex Homer and Dave Sussman. -ch3 illustrated book
Week Developing Web Applications 12. Programming for the Web A Web Application Runs on a Web Server and Presents Its Content to the User Across a Network,
ASP.NET 4 Unleashed Chapter 1. .aspx page: contains C# script and HTML code including tags. Listing 1.1 FirstPage.aspx.
Event Handling. Objectives Using event handlers Simulating events Using event-related methods.
Asp.NET Core Server Controls. Slide 2 Lecture Overview Understanding the types of ASP.NET controls HTML controls ASP.NET (Web) controls.
ASP.NET Data Binding. Slide 2 Lecture Overview Understanding the ASP.NET data binding model.
1111 Creating ASPX Controls Programatically Objectives You will be able to Dynamically add controls to a page. Dynamically alter properties of controls.
PostBack  When an initial request for a page (a Web Form) is received by ASP.NET, it locates and loads the requested Web Form (and if necessary compiles.
Beginning ASP.NET in C# and VB Chapter 9
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
HTML Structure II (Form) WEEK 2.2. Contents Table Form.
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
Chapter 1 Getting Started with ASP.NET Objectives Why ASP? To get familiar with our IDE (Integrated Development Environment ), Visual Studio. Understand.
ASP.NET Forms.
In this session, you will learn to:
Unit 27 - Web Server Scripting
Static and Dynamic Web Pages
ASP.NET.
Module 05: Building ASP .NET Applications
Web Development Using ASP .NET
E-commerce Applications Development
Presentation transcript:

Web Controls Chapter-7

Page  2 Synopsis  Stepping Up to Web controls  Basic Web control classes  Web control classes  Web control Base class  Units, Enumerated values,colors,Fonts

Page  3 Stepping Up to Web controls  They Provide rich user interface design A web control is a programmed object but doesn’t correspond to a single HTML tag.Eg Calendar or DataGrid control.  They Provide a consistent object model The simple textbox can be created by one of the three elements All the above three elements are consolidated as a single text box,

Page  4 Stepping Up to Web controls  The tailor their output automatically ASP.NET recognizes the type of the browser and adjusts the HTML code.The details of the client need not to be known  They Provide high level features The Web controls provide access to the additional events,properties,and methods

Page  5 Basic Web Control Classes Control classUnderlying HTML element Label Button & Text Box & or Check Box RadioButton HyperLink LinkButton with a contained tag ImageButton Image

Page  6 Control classUnderlying HTML element ListBox where X is the number of rows DropDownList CheckBoxListA list or with multiple tags RadioButtonListA list or with multiple tags Panel Table,TableRow And TableCell,, or Basic Web Control Classes

Page  7 The Web control tags  ASP.Net tags have a special format  Always begin with the prefix asp: followed by the class name.  If there is no closing tag they must end with />  Any attribute on the tag corresponds to the control property  Apart from the runat=“server” attribute which declares the control will be processed on the server

Page  8 The Web control tags  Alternatively some text could be placed,set the size property,make it readonly,change the background color  TextBox.TextMode property allows you to specify SingleLine(the default) MultiLine(For text area) Password(For an input control that displays only asterisk) <asp:TextBox id=“textbox1” BackColor=“Yellow” text=“HelloWorld” ReadOnly=“True” TextMode=“MultiLine Rows=“5” runat=“server”

Page  9 Base Controls  Button  CheckBox  RadioButton  Hyperlink  Image  ImageButton  Repeater  Adrotator  Calendar  Label  LinkButton  Panel  Table  TableCell  TableRow  TextBox

Page  10 Web Control Classes  Web control classes are defined in the System.Web.UI.WebControls namespace  ListControl –CheckBoxList –RadioButtonList –ListBox –DropDownList BaseDataList Gridview Repeater Formview

Page  11 BaseValidator  Compare Validator  Custom Validator  Range Validator  Regular Expression Validator  Required Field Validator  Validation Summary

Page  12 The Web Control base class  All Web controls begin by inheriting from the WebControl base class  This class defines the essential functionality

Page  13 The Web Control base class PropertyDescription Access KeySpecifies the key board shortcut as one letter.Eg if you set this to “Y”,the ALT-Y keyboard combination will change focus BackColor,BorderColor and ForeColor Sets the appropriate color Foreground color is used for text BorderWidthSpecifies the size of the control border Border StyleSome of the styles are Dashed,Dotted,Double,Groove,Ridge, Inset,Outset,Solid and None EnabledWhen set to false the control will be visible but will not be able to receive the input from the user

Page  14 The Web Control base class PropertyDescription EnableViewStateTrue:The control uses the hiddenfield to store information about properties FontSpecifies the font to be rendered, System.Drawing.Font.Object Height and WidthSpecifies the width and height of the control PageProvides a reference to the web page that contains this control as a System.Web.UI.Page object TabIndexA number that controls the tab order. The control with the tab index 0 has the focus when the page is loaded. Pressing tab the focus is transferred to the next control with the next tab index ToolTipDisplays a text message when the user hovers the mouse over the control VisibleWhen set to false the control will be hidden and will not be rendered to the final HTML page that is sent to the client

Page  15 Units  All the properties that use measurements including BorderWidth,Height and width use the special Unit structure  When setting the unit in a control tag make sure you add (pixels)px and percentage(%) to number to indicate the type of unit pn1.Height=Unit.Pixel(300) pn1.Width=Unit.Percentage(50)

Page  16 Enumerated Values  Enumerations are used in.NET class library group together a set of related constants  Predefined collections of options for particular property  Eg BorderStyle Property The style can be choosen from the predefined values Dashed Solid Inset Outset Ctrl1.BorderStyle=BorderStyle.Dashed

Page  17 Colors  The color property refers to the color object from the System.Drawing namespace.  The color object can be created in different ways  Using ARGB(alpha,red,green,blue) –Specify each value as integer  Using a predefined.NET color name-Choose the color from the Color class  Using HTML class-You specify this value as a string

Page  18 Fonts  The font property refers to the FontInfo object from the System.Drawing namespace PropertyDescription Name A string indicates the font name(such as “Arial”) Size The size of the font B,I,U,StrikeOut Font style

Page  19 List Controls  CheckboxList control – default multiple selection  RadioButtonList Control -default single selection  ListBox -default single selection [Multiple selection possible SelectionMode property]  Dropdown List - default single selection

Page  20 Table Object Hierarchy Table Object Table Cell Controls Table Cell Controls Table Cell Controls Table Row

Page  21 AutoPostBack  How can you write server code that will react to an event that occurs on the client?  The answer is new innovation called the automatic postback  The Automatic postback submits the page back to the server when it detects a specific user  Here a new updated page is created  All input controls support the Autopostback

Page  22 The following controls that support AutoPostBack EventsWeb controls ClickButton,ImageButton TextChangeTextBox CheckChangedCheckBox,RadioButton SelectIndexChangedAll list controls

Page  23 Page processing sequence Web client Page object created Page load Handler Final Page Is rendered Page object created Page load Handler Run the event handler Final Page Is rendered HTML output rendered Page Postback

Page  24 The PostBack processing sequence  The page object is created from the aspx file  Page.Init event occurs  Controls are populated with information from the viewstate  Page.Load event occurs  All the other events occur  Page.Prerender event occurs  Control information is stored in the viewstate  HTML page is rendered  Page.Unload event occurs  Page object is released from memory

Page  25 How Postback event works  The AutoPostBack feature uses JavaScript function named _doPostback  ASP.NET adds the script automatically to the controls that are set to use the AutoPostBack property  It also adds two additional hidden input fields that are used to pass the information back to the server  Namely ID and value

Page  26  ViewState

Page  27 How Postback event works  Finally the control that has the AutoPostBack property set is connected to the script using the OnClick or OnChage attribute  To say in other words ASP.NET converts the client-side Java script event into server side ASP.NET event using the function  All the above process were done manually in traditional ASP but in ASP.NET framework everything is automatic

Page  28 What happens when the user changes the control that has set the AutoPostBack property  On the client side the Javascript is invoked and the page is resubmitted to the server  ASP.NET recreates the page object for the.aspx file  ASP.NET receives the state information from the hidden field  Updates the control accordingly  The Page.load event is fired  The appropriate change event is fired for the control  The Page.Unload event fires and the page is rendered (Transmitted as a set of objects to HTML)  The new page is sent to the client