Building Web Applications with Visual Basic

aa266578(v=vs.60).md    

You can use Visual Basic to build two different types of Web applications — Dynamic HTML (DHTML) applications and Microsoft® Internet Information Server (IIS) applications. DHTML applications do their processing on the client computer; IIS applications do their processing on the server computer. Additionally, Visual Basic makes it easy for you to incorporate other types of Internet functionality into your applications; for example, you can create and use ActiveX components, including ActiveX controls, documents, and code components. You can also use the WebBrowser control to display HTML or ASP-based pages within a Visual Basic form.

The user interface in your Visual Basic Web application can consist of:

  • A series of HTML pages.
  • A mix of HTML pages and Visual Basic forms.
  • A Visual Basic form that uses controls that provide Internet functionality, such as the WebBrowser control.

You do not have to code the HTML pages yourself. Often, HTML pages are coded by a Web designer instead of a developer. You can focus on using your Visual Basic programming skills to write code that interacts with and uses HTML.

This section provides an overview of the following Visual Basic Web application features.

  • IIS applications
  • DHTML applications
  • Downloading ActiveX components

For More Information   See https://msdn.microsoft.com/en-us/library/aa232764(v=vs.60) , online in MSDN Library Visual Studio 6.0.

IIS Applications

An IIS application (named after Internet Information Server) is a Visual Basic application that uses both HTML and compiled Visual Basic code to create a browser-based application. IIS applications can run in any browser and on either a corporate intranet or the Internet, making it possible to reach a broad audience.

IIS applications physically reside on a Web server, where they receive requests from the browser, run the code associated with the requests, and return responses to the browser.

In addition to simply intercepting a user request and returning an HTML page, you can create IIS applications that perform more advanced functions, such as:

  • Querying databases, writing information to and from records.
  • Retrieving HTML pages, and then replacing portions with dynamic content before sending them to the browser.
  • Dynamically creating HTML elements and generating events for those elements at run time.

These advanced functions make it possible for you to write complex applications, with Visual Basic code replacing scripting, Common Gateway Interface (CGI) processing, and other methods of Internet application development.

Webclasses

An IIS application is composed of an object called a webclass, which contains a series of resources called webitems. The webclass acts as the central functional unit of the application, processing data from the browser and sending information to the users. You define a series of Visual Basic procedures that determine how the webclass responds to these requests. The webitems are the HTML pages and other data the webclass can send to the browser in response to a request.

What About Active Server Pages (ASP) Applications?

IIS applications and ASP applications are quite similar. You can use both technologies to create dynamic, interactive Web applications that reside on the server. Both technologies are capable of calling other code components to perform complex business processing. The major difference between the two, aside from the fact that you code IIS applications using Visual Basic and you code ASP applications using scripting code (either VBScript or JScript), is that IIS applications separate the user interface (HTML or Active Server Pages) from the application code. ASP applications combine the application code and HTML on the same page.

For More Information   See the following topics online in MSDN Library Visual Studio 6.0.

DHTML Applications

A DHTML application is a Visual Basic application consisting of a combination of Dynamic HTML and compiled Visual Basic code. Together these elements create an interactive, browser-based application. DHTML applications are named for Dynamic HTML, a technology extension of Internet Explorer 4.0 and later that makes it possible for users and developers to interact with Web pages in new ways. DHTML applications require Internet Explorer 4.01 or later.

DHTML applications reside on the browser computer, where they interpret and respond to actions the end user performs in the browser.

Although a DHTML application can be as simple as a single HTML page that uses Visual Basic code and the Dynamic HTML object model to respond to objects on the page, you can create more complicated DHTML applications that perform functions like the following:

  • Retrieve data from the user and then use that data to query a database.
  • Update a page's appearance and behavior.
  • Create HTML elements and insert them into a page in response to user requests.

DHTML applications use Visual Basic code to replace scripting, CGI processing, and other methods of Internet application development. More importantly, DHTML applications offload most of the processing from the server to the browser computer.

In addition to writing Visual Basic code to connect to a Web page, you can use a special designer in Visual Basic to create Web pages that act as the user interface of your application. You can also edit an existing Web page in Visual Basic. This way, if you're familiar with HTML or want to create your own pages, you can use the DHTML Page Designer to do so, or you can have someone else create your pages and just add the pages to your application.

The user interface for a DHTML application consists of HTML pages. HTML pages are analogous to forms, in the sense that they contain the visual elements that make up your application's user interface. You can place some of the same items on an HTML page as you can on a form, including text, buttons, check boxes, and option buttons. However, where forms require just the Visual Basic run-time DLL, Msvbm60.dll, in order to display at run time, HTML pages additionally require hosting in either a Web browser or the Internet Explorer 4.0 WebBrowser control.

Differences Between IIS Applications and DHTML Applications

IIS applications and DHTML applications are similar in the sense that both types of applications can respond to events generated by an HTML page. Significant differences between the two include:

  • Dependency   DHTML applications require Internet Explorer 4.0 or later; IIS applications are operating system- and browser-independent.
  • Object model   DHTML applications use the Dynamic HTML object model for programming; IIS applications use the Active Server Pages object model.
  • Location   DHTML applications reside and do most of their work on the browser computer; IIS applications reside and do most of their work on the server computer.

IIS applications are intended for use on either a large corporate intranet with multiple operating systems and browsers or the Internet; DHTML applications are intended for intranets where everyone uses Internet Explorer 4.0 or later.

Sample Applications

Visual Basic includes two sample applications that demonstrate techniques for using DHTML in your applications. These applications are called DhShowMe and PropBag. See the page online in MSDN Library Visual Studio 6.0 for information on how to install the samples.

For More Information   See the following topics online in MSDN Library Visual Studio 6.0.

Downloading ActiveX Components

With Visual Basic, you can use ActiveX technology to create components that you can use on HTML pages or as alternatives to HTML pages. These components can include controls (.ocx files), code components (.exe and .dll files) that run on the client, or ActiveX documents (.vbd files) that function much like an HTML page. All of these components help you create Internet solutions that meet your business needs. Internet component download delivers these ActiveX solutions to users through an Internet browser.

Visual Basic offers support to help you package and download your ActiveX controls, code components, and ActiveX documents. This support includes:

  • The Package and Deployment Wizard, which can help you prepare your software for Internet component download.
  • The License Package Authoring tool, which can help you create license files for HTML pages.

For More Information   See the following topics online in MSDN Library Visual Studio 6.0.