0% found this document useful (0 votes)
29 views19 pages

Creating A Microsoft

Thank you for the feedback. I will review the module content and lab outline to identify any areas for improvement. The goal is to ensure the technical accuracy and learning effectiveness of the materials. Please feel free to provide any other comments - your input will help strengthen the training experience for future students.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views19 pages

Creating A Microsoft

Thank you for the feedback. I will review the module content and lab outline to identify any areas for improvement. The goal is to ensure the technical accuracy and learning effectiveness of the materials. Please feel free to provide any other comments - your input will help strengthen the training experience for future students.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 19

Creating a Microsoft

ASP.NET Web Form


Module 3: Creating a Microsoft ASP.NET Web
Form
• Creating Web Forms

• Adding Server Controls to a Web Form


Lesson: Creating Web Forms
• What Is a Web Form?

• Creating a Web Form by Using Visual Studio 2008

• Demonstration: Converting an HTML Page to a Web Form


What Is a Web Form?

• .aspx extension
• Page attributes
 @ Page directive
• Body attributes
• Form attributes

<%@ Page Language="vb" Codebehind="Default.aspx.vb"


Inherits="WebApplication1._Default" %>
<html>
<body>
<form id="Form1" runat="server">
</form>
</body>
</html>
Creating a Web Form by Using Visual Studio 2008
• New ASP.NET Web Applications create a default Web
Form: Default.aspx

• Create additional Web Forms from the Solution Explorer

• Upgrade existing HTML pages into Web Forms


Demonstration: Converting an HTML Page to a
Web Form
• Change .htm extension to .aspx extension
Lesson: Adding Server Controls to a Web Form
• What Is a Server Control?

• Types of Server Controls

• Saving View State

• Demonstration: Converting HTML Controls to Server


Controls
• HTML Server Controls

• Web Server Controls

• Selecting the Appropriate Control


What Is a Server Control?
<asp:Button ID="Button1" runat="server"
Text="Submit"/>

• Runat="server"
 Events happen on the server
 View state saved

• Have built-in functionality

• Common object model


 All have Id and Text attributes

• Create browser-specific HTML


Types of Server Controls

• HTML server controls

• Web server controls


 Intrinsic controls
 Validation controls
 Rich controls
 List-bound controls
 Internet Explorer Web controls
Saving View State

• View state

<asp:ListBox id="ListName"
EnableViewState="true" runat="server">
</asp:ListBox>

• Control state
Demonstration: Converting HTML Controls to
Server Controls
• Upgrade HTML controls to HTML server controls

• Add a Web server control


HTML Server Controls

• Based on HTML elements


• Exist within the
System.Web.UI.HtmlControls
namespace

<input type="text" id="txtName"


runat="server" />
Web Server Controls

• Exist within the


System.Web.UI.WebControls
namespace
Control syntax
<asp:TextBox id="TextBox1“
runat="server">Text_to_Display
</asp:TextBox>

HTML that is generated by the control


<input name="TextBox1" type="text“
value="Text_to_Display“
Id="TextBox1"/>
Selecting the Appropriate Control

Use HTML Server Use Web Server


Controls if: Controls if:
You prefer an HTML-like You prefer a Visual Basic-
object model like programming model

You are working with You are writing a page


existing HTML pages and
want to quickly add ASP.NET
that might be used by a
Web page functionality variety of browsers

The control will interact You need specific


with client and server functionality such as a
script calendar or ad rotator
Bandwidth is not a
Bandwidth is limited
problem
Creating a Microsoft ASP.NET Web Form
• Exercise 1: Creating the Default.aspx Web Form

• Exercise 2: Creating the Life.aspx Web Form

Logon information
Virtual machine 2310C_03
User name Student
Password Pa$$w0rd

Estimated time: xx minutes


Lab Scenario

Logon Page
Login.aspx
Benefits
Coho Home Page Page Header ASPState
Winery Default.aspx Header.ascx
Menu
Registration Component
Register.aspx Class1.vb or Class1.cs Web.
tempdb
config

Life Insurance Retirement Medical Dental


Life.aspx Retirement.aspx Medical.aspx Dental.aspx

Prospectus Doctors User Control XML Web


Lab Web Prospectus.aspx Doctors.aspx namedate.ascx Service
Application dentalService1.asmx

XML
Doctors Dentists
Files
Lab Review
Module Review and Takeaways
Review Questions
• If you were given a Web page with an .aspx extension,
what would you look for to verify that it is a Web Form?
• If you were given a Web page with an .aspx extension,
what would you look for to see if there are Web server
controls?
• What type of code or script does a Web server control
generate on the client?
• What is the difference between FlowLayout and
GridLayout?
Review for Alpha
• Is there any topic or specific content item in the module
that seemed unclear or unnecessary?
• Is there any content item/related subject area that was
not covered and could be included?
• Did you observe any issues with the technical accuracy of
the content?
• Is the content in the module presented in a manner that
encourages learning? Did the flow of topics seem right?
• Does the lab outline indicate the expected scope of tasks
to be covered? Would you like to suggest any tasks that
could be removed or added?

You might also like