Working with Visual Studio.NET Web Applications
In this tutorial – Introducing Visual Studio.NET Web Applications, You will learn How Web Applications Work, Choose a Language for creation.
Microsoft’s commitment to rapid application development is reflected in Visual Studio 2005 2.0. The .NET framework has blurred the lines between the different programming disciplines and made application development of any kind pleasurable. Web application development specifically has received a boost. With Visual Studio.NET 2005, the facilities available for the Web application developer has been enhanced multifold.
Web applications are of four types. The Web Applications use the power of the Client server technology, and enable the user view applications on a web browser. The Web Services are components that provide processing services from a server to other applications that are deployed over the Internet. Internet Enabled Applications that incorporate all the features of the Internet and provide for online registration, help, updates and other services and Peer to peer applications that use the internet for communication with users running instances of a standalone application.
The difference between web applications and stand alone applications lie in the relative locations of the application and the interface. In stand alone applications, the application and the interface lie in the same machine and messages are passed between the two via the operating system. In Web applications the application lies on a server or a remote machine and the interface can reside in one or more machines located elsewhere. Messages are passed between the two over a network. This difference introduces a number of architectural requirements for the Web application. These include the architecture for messaging over a network. Manipulation of user interface, security, handling multiple users, Identification and state of the users are other factors which are of prime importance for web developers.
How Web Applications Work
Web applications reside on the server and responds to requests made by client systems over the internet. The application is managed by the Microsoft Internet Information Services and the information is passed to the client through the Hypertext Transport Protocol (HTTP) which is a set of rules that describes how two or more items must communicate over a medium such as the Internet. The client hosts a browser on which the web application becomes accessible. The user interface takes the form of a Hypertext Markup Language(HTML) page that are interpreted and displayed on the client’s browser.
A Web Application consists of three parts—content, program logic and Web configuration information. Content defines the type of interface that will be presented to the end user. Web forms, HTML images, audio, Video and other data are part of content. Program Logic defines how the application will respond to user action. This is stored in the form of Executable files, scripts etc. The configuration information determines how the application runs on a server, who can access it etc. The Web configuration file, style sheets, IIS settings etc are the types of files that determine the web configuration.
ASP.NET is the platform on which Visual Studio.NET Web applications are developed. This platform provides a wide level of consistency across web applications and is made up of several components as under:
- Visual Studio .NET Web development tools which include visual tools for designing Web pages and application templates, project management, and deployment tools for Web applications.
. - The System.Web namespaces are part of the .NET Framework and include the programming classes that deal with Web-specific items such as HTTP requests and responses, browsers, and e-mail.
. - Server and HTML control are the user-interface components that you use to gather information from and provide responses to users.
Additionally, ASP.NET relies on Microsoft Internet Information Services to hosts web applications ( the cassini server is integrated for use during development phase in the Beta Version 2.0), the Microsoft Visual Basic.NET or C#.NET or J#.NET programming languages, the .NET framework, the Microsoft ADO.NET database classes and tools and the Microsoft Application Center Test(ACT) for creation and deployment of Web applications. However ASP.NET is not platform independent. It runs only on Windows servers and other tools must be used for creating applications that run on Linux /Unix platforms.
Choosing a Language for creation
The .NET framework makes it possible for web application developers to choose the language of programming they are familiar with. The only condition being that the language should be CLR compliant. In addition to the VB.NET , C#.NET and J#.NET languages incorporated into the .NET framework, the developers can now work with Perl, Pascal, Eiffel, Cobol, Python, Smalltalk and a number of other programming languages. In this tutorial we shall be selecting C# as the language of programming. The following table compares two of the popular programming languages of the .NET framework.
Feature |
Visual Basic .NET |
Visual C# .NET |
Case sensitive |
Not case sensitive: |
Case sensitive: |
Functional blocks |
Use beginning and ending statements to declare functional blocks of code: |
Use braces to declare functional blocks of code: |
Type |
Implicit type conversions are permitted by default: |
Implicit type conversions are limited to operations that are guaranteed not to lose information, such as converting from int to float: |
Comments |
Comments always start with an apostrophe (‘): |
There are three different types of comments: block (/* */), inline (//), and documentation (///): |
Arrays
|
Array elements are specified using |
Array elements are specified using square brackets: |
Methods |
You can omit parentheses after method names if arguments are omitted: |
You must include parentheses after all methods: |
Statement termination |
Statements are terminated by carriage return: |
Statements are terminated by the semicolon (;): |
Statement continuation |
Statements are continued using the underscore (_): |
Statements continue until the semicolon (;) and can span multiple lines if needed: |
String operator |
Use the ampersand (&) or plus sign (+) to join strings: |
Use the plus sign (+) to join strings: strFruit = "Apples" + |
Comparison operators |
Use =, >, <, >=, < =, < > to compare values: |
Use ==, >, <, >=, < =, != to compare values: |
Negation |
Use the Not keyword to express logical negation: |
Use the ! operator to express logical negation: |
Object comparison |
Use the Is keyword to compare object variables: |
Use == to compare object variables: |
Object existence |
Use the Nothing keyword or the IsNothing function to check whether an object exists: |
Use the null keyword to check whether an object exists: |
Apart from the above cited distinctions, there significant keyword usage differences in the two languages. The Visual studio.NET help topic titled “Language Equivalents” is directed towards assisting users attempting to understand or translate code from one language to another.