Web Forms and XML Web Services

21
06/17/22 1 Web Forms and XML Web Services Tuc Goodwin

description

Web Forms and XML Web Services. Tuc Goodwin. Introduction . This is the Eighth of 15 planned presentations Upcoming presentations:. This Month’s Objective:. Our overall objective is to - PowerPoint PPT Presentation

Transcript of Web Forms and XML Web Services

Page 1: Web Forms and XML Web Services

04/22/23 1

Web Forms and XML Web Services

Tuc Goodwin

Page 2: Web Forms and XML Web Services

04/22/23 2

Introduction This is the Eighth of 15 planned presentations Upcoming presentations:Date Title

5/15/05 Web Forms and XML Web Services

6/11/05 Using ADO.NET7/9/05 TBD (Tuc is on Vacation)8/13/05 Deploying Applications

Page 3: Web Forms and XML Web Services

04/22/23 3

This Month’s Objective:

Our overall objective is to

This Presentation explains how to create menus, status bars, and toolbars to enhance the usability of an application.

Page 4: Web Forms and XML Web Services

04/22/23 4

Demonstration Code

We will build a short demonstration application as we go through this lecture.

All code samples can be downloaded from:http://groups.msn.com/NTPCUGDevToolsSIG And soon Beginning VB.NET SharePoint Site:http://69.41.237.216:879/BEGVBNET/default.aspx End With

Page 5: Web Forms and XML Web Services

04/22/23 5

Agenda What this presentation is not… What is a Web Form? Web Form Semi-Basics Web Form Life Cycle Creating a Web Form What is a Web Service? Creating a Web Service Testing a Web Service Consuming a Web Service from a Web Form

Page 6: Web Forms and XML Web Services

04/22/23 6

What this presentation is not… A how-to on writing HTML

HTML is an important skill, but you need to develop it yourself. There are many, many web-sites on the Internet that can provide direction.(can you spell G-O-O-G-L-E?)

All encompassing… This is a taste of web development. If you want to

be good at it, you will need to practice. There is a lot that I’m NOT going to cover. The ASP.NET SIG is a really good place to start.

Page 7: Web Forms and XML Web Services

04/22/23 7

What is a Web Form?

A web form is the basic building block for an ASP.NET application. Essentially it is a web page that is rendered by a web server to a browser.

It is stored in a file folder that is used by a virtual folder. Virtual Folders specify where your web application projects are physically stored.

Page 8: Web Forms and XML Web Services

04/22/23 8

Web Form Semi-Basics

Page 9: Web Forms and XML Web Services

04/22/23 9

Web Form Life Cycle

IHTTPHandler.ProcessRequest method of Page class is invoked.

Adapted from Essential ASP.NET with examples in C# by Fritz Onion (ISBN: 0201760401)and Essential ASP.NET with examples in VB.NET by Fritz Onion (ISBN: 0201760398)

Page-derived class is created, constructor is invoked

Virtual RenderChildren method pf Page class is invoked

Load event of Page class fires

Init Event of Page class fires

POST request is issued by client

Virtual Render method of Page class is invoked

Server-side control state is restored from POST variables and VIEWSTATE

Virtual CreateChildControls method of Page is Invoked

Instance of Page-derived class is discarded

PreRender event of Page class fires

HTTP Response issued to client

Server-Side control events are fired

Unload event of Page class fires

Page 10: Web Forms and XML Web Services

04/22/23 10

Creating a Web Project

Page 11: Web Forms and XML Web Services

04/22/23 11

Flow vs. Grid Layout

Page 12: Web Forms and XML Web Services

04/22/23 12

Creating a Web Form

Page 13: Web Forms and XML Web Services

04/22/23 13

Editing a Web Form

Page 14: Web Forms and XML Web Services

04/22/23 14

What is a Web Service? A web service is an

application that exists on the internet/intranet, responds to remote procedure calls, and does not contain a user interface.

The example I am using comes from the book Visual Basic.NET Tips & Techniques by Kris Jamsa (ISBN:0072223189 )

Page 15: Web Forms and XML Web Services

04/22/23 15

Creating a Web Service

Page 16: Web Forms and XML Web Services

04/22/23 16

Coding a Web Service

<WebMethod()> Public Function DateOnly() As String DateOnly = Date.Today.Date.ToString End Function

Page 17: Web Forms and XML Web Services

04/22/23 17

Testing a Web Service

Page 18: Web Forms and XML Web Services

04/22/23 18

Consuming a Web Service from a Web Form

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim myWebService As New localhost.Service1

If Me.RadioButton1.Checked Then Me.TextBox1.Text = myWebService.DateTime If Me.RadioButton2.Checked Then Me.TextBox1.Text = myWebService.DateOnly If Me.RadioButton3.Checked Then Me.TextBox1.Text = myWebService.TimeOnly If Me.RadioButton4.Checked Then Me.TextBox1.Text = myWebService.DayOfWeek

End Sub

Page 19: Web Forms and XML Web Services

04/22/23 19

Summary

We…Created a Web Form

Consumed a Web Service

and we wrote some more code…

We’ll continue to build from here…

Page 20: Web Forms and XML Web Services

04/22/23 20

Next Time…

Using ADO.NET

Page 21: Web Forms and XML Web Services

04/22/23 21

Questions?