Creating Custom Controls with User Controls. Including Standard Content with User Controls Global Super Company Global Super Company We mean business!

Slides:



Advertisements
Similar presentations
Web Page Design Using Tables Here you see three examples of how tables can be used to organize your content. We call this page layout or design. You can.
Advertisements

1. Write an Excel text function in cell Company Data!A4, which may be copied down, to string together the first and last name with only the first letter.
Wincite Introduces Knowledge Notebooks A new approach to collecting, organizing and distributing internal and external information sources and analysis.
CREATE A WEBPAGE WEB DESIGN. EXAMPLE LAYOUT 2 WEB COMPONENTS Header Banner and logo Footer Copyright information or Address Horizontal Navigation For.
PHP –Writing Reusable Code 10 March 2006 Adina Crainiceanu IT420: Database Management and Organization.
ASP.NET 2.0. What is ASP.NET is a server-side scripting language developed by Microsoft is the next generation of ASP (Active Server Pages), completely.
Presented By Eyyup Gur Volkan Dogan. Structure Website has webbed structure to connect and link pages and so it has multidirectional navigation. In other.
Lesson 6. Links in HTML Computer Science Welcome to Virtual University in Pakistanhttp://
Telerik Software Academy ASP.NET Web Forms Data Validation, Data Validators, Validation Groups Telerik Software Academy
Module 3 Administering SmartBenefits. In this module, you will learn how to perform the following functions: 1. add administrator 2. modify an account.
INSPIRING CREATIVE AND INNOVATIVE MINDS Module 4: Adding Code to a Microsoft ASP.NET Web Form Implementing Code-Behind Pages Adding Event Procedures to.
ASP.NET Event Handlers Database -> Browser ->Shopping Basket Validators.
ASP.NET Presented by Pan Gao. ASP.NET Next generation of ASP Next generation of ASP Program Language to build web application Program Language to build.
Language Club KompoZer Design View. Files you will need  Images  pages  Templates  Text.
Programming Test #1 Solutions. Multiple Choice 1. B) the grammar of the coding language 2. C) String 3. A) Single 4. C) 2Burgers4Me 5. B) Design Time.
1 CS 3870/CS 5870 Note04 Session Variables and Post Back.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Unit 3: Adding Code to a Microsoft ASP.NET Web Form.
Table Row Table Data ( Header & Data) Data Cell Padding TABLE.
Application Tracing and Error Handling. Catching Exceptions with TRY … CATCH Sub Page_Load Dim conNorthwind As SqlConnection Dim cmdSelect As SqlCommand.
Example page BASICS. Example page AN EXAMPLE by V.R. Voller This is in blue starts a new paragraph and another a line with no break even with a return.
CIS 375—Web App Dev II ASP.NET 8 More Binding. 2 The Repeater ControlThe Repeater Control 1 The Repeater control is used to display a repeated list of.
A table is a rectangular arrangement of rows and columns on your screen A table is used to organize data into rows and columns and also increasingly.
Session 4: HTML and Web Server Controls. Outline Creating Web Forms Using Server Controls HTML Server Controls Web Server Controls Writing ASP Code Inline.
Module 1: Working with ASP.NET. Overview Introducing ASP.NET Creating Web Forms Adding ASP.NET Code to a Page Handling Page Events Discussion: ASP vs.
Microsoft Access Lesson 2 Lexington Technology Center February 13, 2003 Bob Herring On the Web at
PAGE DIRECTIVES. Page Directives  They are instructions, inserted at the top of an ASP.NET page, to control the behavior of ASP.NET pages.  So it is.
Word Forms Gini Courter Annette Marquis TRIAD Consulting Welcome to….
Module 8: Creating User Controls. Overview Adding User Controls to an ASP.NET Web Form Creating User Controls.
Sending . Microsoft SMTP Service Simple Mail Transport Protocol Does not support the Post Office Protocol (POP) InetPub\MailRoot\Pickup InetPub\MailRoot\Drop.
CIS 375—Web App Dev II ASP.NET 3 Working With Server Controls.
June 23, 2001Database Creation Review and Exercises1 Building an Application - Part I -
CSCI 4230 Homework #3 Group Three Samer Al Jefri * Kevin Odom * David Hood * JD * Phil.
Main Title Here Additional copy here, additional copy here, additional copy here, additional copy here, additional copy here. ADD YOUR WEB ADDRESS HERE.
Web Application Development Introduction. Lesson: Creating Web Forms What is a Web Form? Creating a Web Form with Visual Studio.NET.
ASP (COMPONENTS) Active Server Pages (cont..) 1. global.asa file The Global.asa file is an optional file that can contain declarations of objects, variables,
Working With ASP.NET Application. Create a new virtual directory The procedure to create a new virtual directory Internet Services Manager Right click.
CSCI 4230 Homework #3 Group Three Samer Al Jefri * Kevin Odom * David Hood * JD Wells * Philippe Gambling.
CIS 375—Web App Dev II ASP.NET 4 Server Controls.
CIS 375—Web App Dev II ASP.NET 5 Events. 2 The Page_Load Event The Page_Load event is triggered when a page loads. [Example]Example Sub Page_Load lbl1.Text="The.
1111 Creating ASPX Controls Programatically Objectives You will be able to Dynamically add controls to a page. Dynamically alter properties of controls.
1 Creating a Menu Bar on a Secondary Web Page  It is important for visitors to be able to move easily from one page to another  You will create a menu.
Event Handling & Viewstate CS 351 Ed Gellenbeck. Today Review of Web Forms ASP.NET Object Hierarchy Events State Management Page State Session State Application.
Web and Multimedia Development Copyright © Genetic Computer School 2007WM LESSON OVERVIEW  Use of Tables  Creating Tables  Try It – 1  Creating.
This is the software we will use to load our html page up to the server. You can download a copy for home if you want to.
1 R3 R1 R5 R4 R6 R2 B B A A Looking at the Code Under the View menu Select Source.
Validation & Rich Controls
Using the Personal Image Photo Library
Computing with C# and the .NET Framework
CS 3870/CS 5870 Web User Controls.
Security Basics and ASP.NET Support
How to Create a Simple Web Service and Use it in ASP.Net
Signing up or logging in to your user account:
CSI 101 Elements of Computing – Spring 2009
Web Services Introduction
Event Title Event Intro Event Subtitle Date Time Location
Campus Band Battle Date 00pm – 00pm Location All Ages Event
Title of Your Event Event Date Event Time
Lesson Objectives Lesson Outcomes
Title of Your Event Event Date Event Time
Introducing ASP.net with Visual Studio Environment
Web Design and Development
Campus EVENT Date 00 – 00 p.m. Location All Ages Event info additional
Campus Band Battle Date 00pm – 00pm Location All Ages Event
Searching Your Database
Event Title Event Intro Event Subtitle Date Time Location
Work Order Company Name 123 Your Street Your City, ST, 01234
Main Title Here ADD YOUR WEB ADDRESS HERE
Button Web Server Controls
Headline Headline Headline
Validation & Rich Controls
Presentation transcript:

Creating Custom Controls with User Controls

Including Standard Content with User Controls Global Super Company Global Super Company We mean business! File name: SimpleHeader.ascx

Including Standard Content with User Controls Register TagPrefix="SuperCompany" TagName="Header" Src="SimpleHeader.ascx" %> <Supercompany:Header ID="ctlHeader" Runat="Server" /> Welcome to our home page! File Name: HomePage.aspx

Including Standard Content with User Controls ► TagPrefix  The alias to associate with the user control ’ s namespace ► TagName  The alias to associate with the user control ’ s class ► Src  The virtual path to the file containing the user control

Including Standard Content with User Controls <table width="90%" cellpadding="2" cellspacing="0" border="1" bordercolor="red"> File Name: Divider.ascx

Including Standard Content with User Controls UserControlsDivider.aspx Here is some text... Here is some more text... Yet some more text... File Name: UserControlsDivider.aspx

Exposing Properties and Methods in User Controls Public PageTitle As String = "Global Super Company" Global Super Company We mean business! File Name: HeaderTitle.ascx

Exposing Properties and Methods in User Controls Register TagPrefix="SuperCompany" TagName="Header" Src="HeaderTitle.ascx" %> <Supercompany:Header ID="ctlHeader" PageTitle="The Home Page" Runat="Server" /> Welcome to our home page! File Name: HomePageTitle.aspx

Exposing Properties and Methods in User Controls Public Word As String Sub Repeat( intNumTimes As Integer ) Dim intCounter As Integer For intCounter = 0 to intNumTimes - 1 Response.Write( Word ) Next End Sub File Name: WordRepeater.ascx

Exposing Properties and Methods in User Controls Register TagPrefix="SuperCompany" TagName="WordRepeater" Src="WordRepeater.ascx" %> Sub Page_Load myWordRepeater.Repeat( 50 ) End Sub DisplayWordRepeater.aspx <SuperCompany:WordRepeater ID="myWordRepeater “ Word="Hello" Runat="Server" /> File Name: DisplayWordRepeater.aspx

Exposing Web Controls in User Control Street Address: City: State: ZIP: File Name: Address.ascx

Exposing Web Controls in User Control Register TagPrefix="SuperCompany" TagName="Address" Src="Address.ascx" %> DisplayAddress.aspx Billing Address Shipping Address File Name: DiaplayAddress.aspx

Exposing Web Controls in User Control Public Property Street As String Get Return txtStreet.Text End Get Set txtStreet.Text = Value End Set End Property Public Property City As String Get Return txtCity.Text End Get Set txtCity.Text = Value End Set End Property Public Property State As String Get Return txtState.Text End Get Set txtState.Text = Value End Set End Property Public Property ZIP As String Get Return txtZIP.Text End Get Set txtZIP.Text = Value End Set End Property Street Address: <asp:TextBox ID="txtStreet" Runat="Server" /> City: <asp:TextBox ID="txtCity" Runat="Server" /> State: <asp:TextBox ID="txtState" Runat="Server" /> ZIP: <asp:TextBox ID="txtZIP" Runat="Server" /> File Name: AddressProperties.ascx

Exposing Web Controls in User Control Register TagPrefix="SuperCompany" TagName="Address" Src="AddressProperties.ascx" %> Sub Button_Click( s As Object, e As EventArgs ) lblOutput.Text = " You entered the following values: " lblOutput.Text &= " Billing Address: " lblOutput.Text &= " Street: " & ctlBillingAddress.Street lblOutput.Text &= " City: " & ctlBillingAddress.City lblOutput.Text &= " State: " & ctlBillingAddress.State lblOutput.Text &= " ZIP: " & ctlBillingAddress.ZIP lblOutput.Text &= " " lblOutput.Text &= " Billing Address: " lblOutput.Text &= " Street: " & ctlShippingAddress.Street lblOutput.Text &= " City: " & ctlShippingAddress.City lblOutput.Text &= " State: " & ctlShippingAddress.State lblOutput.Text &= " ZIP: " & ctlShippingAddress.ZIP End Sub DisplayAddressProperties.aspx Billing Address <SuperCompany:Address ID="ctlBillingAddress" Runat="Server" /> Shipping Address <SuperCompany:Address ID="ctlShippingAddress" Runat="Server" /> <asp:Button Text="Submit" OnClick="Button_Click" Runat="Server" /> <asp:Label ID="lblOutput" Runat="Server" /> File Name: DiaplayAddressProperties.aspx

Exposing Events in User Control Sub Page_Load Dim RanNum As New Random Select Case RanNum.Next( 3 ) Case 0 lblQuote.Text = "A penny saved is a penny earned" Case 1 lblQuote.Text = "Look before you leap" Case 2 lblQuote.Text = "He who hesitates is lost" End Select End Sub <asp:Label id="lblQuote" Runat="Server" /> File Name: ControlEvents.ascx

Exposing Events in User Control Register TagPrefix="SuperCompany" TagName="Quote" Src="ControlEvents.ascx" %> <SuperCompany:Quote Runat="Server" /> File Name: DisplayControlEvents.aspx