Professional Documents
Culture Documents
Developing Web Applications Using Microsoft Visual Studio 2008
Developing Web Applications Using Microsoft Visual Studio 2008
Using
Microsoft® Visual
Studio® 2008
Module 7: Creating and Implementing User Controls
• Adding User Controls to an ASP.NET Web Form
or
<%@ Control Language="VB" %>
Page3.aspx
Page1.aspx
Page2.aspx
Lesson: Creating User Controls
• Creating a User Control
[Visual Basic]
num1.pNum = 5 'uses Set
x = num1.pNum 'uses Get
Demonstration: Creating and Implementing a
User Control
• Create a new user control
• Create a property
Logon information
Virtual machine 2310C-LON-DEV-07
Master Page
Logon Page benefitsMaster.master
login.aspx
Benefits Lab Web
Home Page Application
ASPState
Default.aspx Page Header
header.ascx
Menu Component
Registration Benefits.cs or Benefits.vb
register.aspx TempDB
Web.
config
Prospectus
prospectus.aspx Doctors User Control XML Web
LINQ to SQL doctors.aspx nameDate.ascx Service
Classes DentalService1.asmx
Doctors.dbml
Doctors Dentists
XML Files
Lab Review
Review Questions
• What is the purpose of the properties that you created for
the user control in Exercise 1?
• What is the syntax of the @ Register directive for the
user control?
• What is the HTML tag syntax for the user control?
Module Review and Takeaways
• Review Questions
• Best Practices