E-commerce Applications Development

Slides:



Advertisements
Similar presentations
1111 Creating ASPX Controls Programatically Objectives You will be able to Dynamically add controls to a page. Dynamically alter properties of controls.
Advertisements

Client-Side Internet and Web Programming
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.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 3-1 of…
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
11 ASP.NET Controls Beginning ASP.NET 4.0 in C# 2010 Chapter 6.
ASP.NET Programming with C# and SQL Server First Edition
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.
4-Sep-15 HTML Forms Mrs. Goins Web Design Class. Parts of a Web Form A Form is an area that can contain Form Control/Elements. Each piece of information.
Forms and Form Controls Chapter What is a Form?
Dreamweaver -- CSS. Dreamweaver -- MX New icons are added in MX Most of the features commonly used in web design, and are same as FrontPage. New feature.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
XHTML and CSS Links, Images, Tables and Forms Bharti Patel 1 phones off (please)
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Introducing Web Controls Outline 29.1 Analyzing the.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 4-1 of…
CSS The Definitive Guide Chapter 8.  Allows one to define borders for  paragraphs  headings  divs  anchors  images  and more.
ASP.NET Web Server Controls Basic Web Server Controls.
Web Controls Chapter-7. Page  2 Synopsis  Stepping Up to Web controls  Basic Web control classes  Web control classes  Web control Base class  Units,
Chapter 4 – Working with ASP.NET Controls Dr. Stephanos Mavromoustakos.
CSS Border.
CSC 2720 Building Web Applications HTML Forms. Introduction  HTML forms are used to collect user input.  The collected input is typically sent to a.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
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.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
1 Review of Form Elements. 2 The tag Used in between tags.  Form elements(text control, buttons, etc.. ) goes here. OR  Form elements(text control,
HTML Forms a form is a container for input elements on a web page input elements contain data that is sent to the web server for processing.
+ FORMS HTML forms are used to pass data to a server. begins and ends a form Forms are made up of input elements Every input element has a name and value.
Asp.NET Core Server Controls. Slide 2 Lecture Overview Understanding the types of ASP.NET controls HTML controls ASP.NET (Web) controls.
11 ASP.NET Server Controls Beginning ASP.NET in C# and VB Chapter 4.
1111 Creating ASPX Controls Programatically Objectives You will be able to Dynamically add controls to a page. Dynamically alter properties of controls.
Web Forms. Web Forms: A form allows our web visitors to submit information to us. Some examples uses for forms are to let the web user contact us, fill.
HTML Structure II (Form) WEEK 2.2. Contents Table Form.
CSS. What does it stand for? ___________________.
ASP.NET Part 2 Instructor: Charles Moen CSCI/CINF 4230.
Web Controls.
Validation & Rich Controls
Development of Internet Application 1501CT - Sara Almudauh
Working with ASP.NET Server Controls
Organizing Content with Lists and Tables
Table Styling.
Table Styling.
Semester - Review.
Table Styling.
Web Development & Design Foundations with HTML5 8th Edition
HTML Forms Pat Morin COMP 2405.
ASP.NET Web Controls.
Basic XHTML Tables XHTML tables—a frequently used feature that organizes data into rows and columns. Tables are defined with the table element. Table.
Cascading Style Sheets (Formatting)
Visual programming Chapter 3: GUI (Graphical User Interface) Part I
Introducing Forms.
ASP.NET Controls IT533 Lecture.
FORM OBJECT When creating an interactive web site for the Internet it is necessary to capture user input and process this input. Based on the result of.
CNIT 131 HTML5 - Forms.
Web Development & Design Foundations with H T M L 5
Static and Dynamic Web Pages
ASP.NET.
Module 05: Building ASP .NET Applications
Web Development Using ASP .NET
E-commerce Applications Development
Programming with Microsoft Visual Basic 2008 Fourth Edition
Button Web Server Controls
Validation & Rich Controls
Presentation transcript:

E-commerce Applications Development 0731465 Done by Raneem Qaddoura

Lecture 1 Web controls (1)

reasons for switching to web controls They provide a rich user interface. They provide a consistent object model They tailor their output automatically: They provide high-level features ASP.NET exposes a web control as a single object on the server side for convenient programming, thus illustrating one of the primary strengths of web controls. Web Controls are case insensitive: web page tolerates different capitalization for tag names, property names, and enumeration values

Web Control Hierarchy

Basic Web Control classes Underlying HTML Element Label <span> Button <input type=“submit”> or <input type=“button”> TextBox <input type=“text”>, <input type=“password”>, or <textarea> CheckBox <input type=“checkbox”> RadioButton <input type=“radio”> Hyperlink <a> LinkButton <a> with a contained <img> tag ImageButton <input type=“image”> Image <img> ListBox <select size=“x”> where X is the number of rows that are visible at once DropDownList <select> CheckBoxList A list or <table> with multiple <input type=“checkbox”> tags RadioButtonList A list or <table> with multiple <input type=“radio”> tags BulletedList An <ol> ordered list (numbered) or <ul> unordered list (bullited) Panel <div> Table, TableRow, and TableCell <table>, <tr>, and <td> or <th>

ASP.NET TextBox Web Control: HTML Server control: <asp:TextBox ID="txt" runat="server" /> <input type="text" ID="txt" name="txt" />

A customized text box <asp:TextBox ID="txt" BackColor="Yellow" Text="Hello World" ReadOnly="true" TextMode="MultiLine" Rows="5" runat="server" /> <textarea ID="txt" name="txt" rows="5" cols="20" readonly="readonly" style="background-color:Yellow;">Hello World</textarea>

The Web Control Base Class Property Description AccessKey Specifies the keyboard shortcut as one letter. For example, if you set this to Y, the Alt+Y keyboard combination will automatically change focus to this web control. BackColor, ForeColor, and BorderColor Sets the colors used for the background, foreground, and border of the control. In most controls, the foreground color sets the text color. BorderWidth Specifies the size of the control border. BorderStyle One of the values from the BorderStyle enumeration, including Dashed, Dotted, Double, Groove, Ridge, Inset, Outset, Solid, and None. Controls Provides a collection of all the controls contained inside the current control. Enabled When set to false, the control will be visible, but it will not be able to receive user input or focus. EnableViewState Set this to false to disable the automatic state management for this control. Font Specifies the font used to render any text in the control as a System.Web.UI.WebControls.FontInfo object. Height and Width Specifies the width and height of the control. Page Provides a reference to the web page that contains this control as a System.Web.UI.Page object. Parent Provides a reference to the control that contains this control. TabIndex A number that allows you to control the tab order. ToolTip Displays a text message when the user hovers the mouse above the control. Visible When set to false, the control will be hidden and will not be rendered to the HTML page that is sent to the client.

Units <asp:Panel Height="300px" width="50%" ID="pnl" runat="server" /> // Convert the number 300 to a Unit object // representing pixels, and assign it. pnl.Height = Unit.Pixel(300); // Convert the number 50 to a Unit object // representing percent, and assign it. pnl.Width = Unit.Percentage(50); // Create a Unit object. Unit myUnit = new Unit(300, UnitType.Pixel); // Assign the Unit object to several controls or properties. pnl.Height = myUnit; pnl.Width = myUnit;

Lecture 2 Web controls (2)

Enumerations Such as BorderStyle enumeration, including Dashed, Dotted, Double, Groove, Ridge, Inset, Outset, Solid, and None values. <asp:Label BorderStyle="Dashed" Text="Border Text" ID="lbl" runat="server" /> lbl.BorderStyle = BorderStyle.Dashed;

Colors <asp:TextBox ForColor="red" Text="Test" ID="txt" runat="server" /> <asp:TextBox ForColor="#ff55ff" Text="Test" ID="txt" runat="server" /> using System.Drawing; // Create a color from an ARGB value int alpha = 255, red = 0, green = 255, blue = 0; txt.ForeColor = Color.FromArgb(alpha, red, green, blue); // Create a color using a .NET name txt.ForeColor = Color.Crimson; // Create a color from an HTML code txt.ForeColor = ColorTranslator.FromHtml("Blue");

Font <asp:TextBox ForColor="red" Text="Test" ID="txt" runat="server" /> <asp:TextBox ForColor="#ff55ff" Text="Test" ID="txt" runat="server" /> // Change font name txt.Font.Name = "Georgia";

DropDownList, CheckBoxList, and RadioButtonList <asp:DropDownList ID="list" runat="server" /> <asp:CheckBoxList ID="list" runat="server" /> <asp:RadioButtonList ID="list" runat="server" /> list.Items.Add("C"); list.Items.Add("C++"); list.Items.Add("C#"); list.Items.Add("Java"); list.Items.Add("PHP"); list.Items.Add(new ListItem("Apple", "1")); list.Items.Add(new ListItem("Orange", "2")); list.Items.Add(new ListItem("Banana", "3")); list.Items.Add(new ListItem("Millon", "4"));

The page Processing Sequence

Web control Events Property Web Control Always Posts Back Click Button, ImageButton True TextChanged TextBox (fires only after the user changes the focus to another control) False CheckedChanged CheckBox, RadioButton SelectedIndexChanged DropDownList, ListBox, CheckBoxList, RadioButtonList

Lecture 3 ExampleS

Example: Greeting Card

Example: Greeting Card <!-- Here are the controls: --> Choose a background color:<br> <asp:DropDownList ID="lstBackColor" runat="server" Width="194px" Height="22px" /><br><br> Choose a font:<br> <asp:DropDownList ID="lstFontName" runat="server" Width="194px" Height="22px" /><br><br> Specify a numeric font size:<br> <asp:TextBox ID="txtFontSize" runat="server" /><br><br> Choose a border style:<br> <asp:RadioButtonList ID="lstBorder" runat="server" Width="177px" Height="59px" /><br><br> <asp:CheckBox ID="chkPicture" runat="server" Text="Add the Default Picture"></asp:CheckBox> <br><br> Enter the greeting text below:<br> <asp:TextBox ID="txtGreeting" runat="server" Width="240px" Height="85px" TextMode="MultiLine" /><br><br> <asp:Button ID="cmdUpdate" OnClick="cmdUpdate_Click" runat="server" Width="71px" Height="24px" Text="Update" /> <!-- Here is the card: --> <asp:Panel ID="pnlCard" runat="server" Width="339px" Height="481px" HorizontalAlign="Center"><br> <asp:Label ID="lblGreeting" runat="server" Width="256px" Height="150px" /><br><br><br> <asp:Image ID="imgDefault" runat="server" Width="212px" Height="160px" /> </asp:Panel>

Example: Greeting Card protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) // Set color options. lstBackColor.Items.Add("White"); lstBackColor.Items.Add("Red"); lstBackColor.Items.Add("Green"); lstBackColor.Items.Add("Blue"); lstBackColor.Items.Add("Yellow"); // Set font options. lstFontName.Items.Add("Times New Roman"); lstFontName.Items.Add("Arial"); lstFontName.Items.Add("Verdana"); lstFontName.Items.Add("Tahoma"); // Set border style options by adding a series of ListItem objects. ListItem item = new ListItem(); // The item text indicates the name of the option. item.Text = BorderStyle.None.ToString();

Example: Greeting Card // The item value records the corresponding integer from the enumeration. // To obtain this value, you must cast the enumeration value to an integer, // and then convert the number to a string so it can be placed in HTML page. item.Value = ((int)BorderStyle.None).ToString(); // Add the item. lstBorder.Items.Add(item); // Now repeat the process for two other border styles. item = new ListItem(); item.Text = BorderStyle.Double.ToString(); item.Value = ((int)BorderStyle.Double).ToString(); item.Text = BorderStyle.Solid.ToString(); item.Value = ((int)BorderStyle.Solid).ToString(); // Select the first border option. lstBorder.SelectedIndex = 0; // Set the picture. imgDefault.ImageUrl = "image1.jpg"; }

Example: Greeting Card protected void cmdUpdate_Click(object sender, EventArgs e) { // Update the color. pnlCard.BackColor = Color.FromName(lstBackColor.SelectedItem.Text); // Update the font. lblGreeting.Font.Name = lstFontName.SelectedItem.Text; if (Int32.Parse(txtFontSize.Text) > 0) { lblGreeting.Font.Size = FontUnit.Point(Int32.Parse(txtFontSize.Text)); } // Update the border style. int borderValue = Int32.Parse(lstBorder.SelectedItem.Value); pnlCard.BorderStyle = (BorderStyle)borderValue; // Update the picture. if (chkPicture.Checked) { imgDefault.Visible = true; }else { imgDefault.Visible = false; // Set the text. lblGreeting.Text = txtGreeting.Text;

References Beginning, A. S. P. (2007). .NET 3.5 in C# 2008: From Novice to Professional , M. MacDonald, Apress. https://www.w3schools.com/

The End