Creating a Simple XML Web Service

You probably won't be surprised to discover that Microsoft Visual Studio .NET provides powerful tools to help you create XML Web services. The ease of creating XML Web services is nothing short of amazing, as you'll see. XML Web services reside in a folder that's also a virtual directory in Internet Information Services (IIS). XML Web services can have the same security settings as traditional Web folders, although you must be careful to ensure that XML Web services that are accessed by other...

Listing 85 SimpleSPSelectaspx showing how to display the results from the Ten Most Expensive Products stored procedure

> < DOCTYPE HTML PUBLIC - W3C DTD HTML 4.0 Transitional EN > < HTML> < HEAD> < meta name GENERATOR Content Microsoft Visual Studio 7.0> < meta name CODE_LANGUAGE Content C > < meta name vs_defaultClientScript content JavaScript (ECMAScript)> < meta name vs_targetSchema < HEAD> < body> < form id Form1 method post runat server> < TABLE WIDTH 300 BORDER 0 CELLSPACING 1 CELLPADDING 1> < TR bgcolor ffff66> < TD> < TR bgcolor ffffc3> < TD>...

Consuming a Simple XML Web Service

Writing an XML Web service is a wonderful accomplishment, but using it is even better. There are several ways to consume an XML Web service. The easiest way is to use Visual Studio and add a Web reference to the service. (Command-line purists should refer to the next section, XML Web Services and Command-Line Tools.) The first step in this process is to create a new Web application, with a new Web Forms page. In the Solution Explorer window, right-click the project name, and choose Add Web...

Aspnet Web Form Stages

The life cycle of an ASP.NET Web Form has five basic stages Page_Init The ASP.NET page framework uses this event to restore control properties and postback data (data entered in controls by the user before the form was submitted). Page_Load The developer uses this event either to perform some initial processing (if this is the first visit to the page) or to restore control values (if this is a postback). Validation The Validate method of ASP.NET server controls is called to perform validation...

Configuring an Application

One element seems to be missing from the Visual Basic .NET code shown in Listing 4-3. Although I've often extolled the virtue of using Option Explicit, I didn't use it in this example, which can be done by setting Explicit true in Page. I can assure you that the page does require variables to be declared I missed one of the references to loop when converting the application from C to Visual Basic .NET and an error page did in fact appear, as shown in Figure 4-13. J J 2 T----- Jmtfi J-H n. J i...

Visual Basic NET Example

The same page created using Visual Basic .NET is shown in Listing 4-3. This listing isn't much different from the C example presented in Listing 4-2. Listing 4-3 SayHelloASPDOTNETVB.aspx sample application listinc lt Page Language VB gt lt HTML gt lt HEAD gt lt TITLE gt My First ASPX Page lt TITLE gt lt HEAD gt lt BODY gt Dim tLoop as Integer Dim s as String s lt FONT SIZE 0 gt Hello ASP.NET World lt FONT gt lt BR gt , tLoop lt SPAN id Message runat server gt Figure 4-1 shows the output from...

The sessionState Section

Session state support in ASP.NET is much more extensive and flexible than it was in ASP. For developers of small Internet or intranet Web sites, the session support offered by ASP was adequate. The problem was that ASP session state didn't scale out to multiple Web servers. ASP session state was stored on the Web server, and so using a system like Microsoft's Network Load Balancing provided no assurance that the same server in a Web server farm would service each request from a particular...

Better Solution Active Server Pages

If you're wondering why we've dwelt on the alternatives to ASP.NET in a book about programming ASP.NET, the answer lies in the details of the implementation of ASP.NET and its predecessor, Active Server Pages ASP . Understanding ISAPI is required for a deeper understanding of ASP and thus ASP.NET. During the beta of IIS 2.0, which became part of Windows NT 4.0, Microsoft introduced a new technology initially codenamed Denali. This was during Microsoft's Active period, and so the technology was...

The Compare Validator Control

Referring back to Login.aspx, in Listing 5-1, you'll see that logic is used to compare the e-mail address and password entered to hard-coded values. If the e-mail and password don't match what's expected, another label on the form will be set to a message requesting the user to try again. We haven't seen that message yet, because when we clicked the Login button, the client-side validators fired and displayed those red asterisks before the form was submitted. Because the client-side validators...