Exforsys

ASP.NET 2.0

  1. Getting started with ASP.NET 2.0
  2. .NET Framework Fundamentals
  3. Microsoft.NET Framework Tools
  4. Application Development in .NET
  5. What's New in the .NET Framework 2.0 ?
  6. Introduction to Visual Studio.NET
  7. Installing Visual Studio.NET 2005
  8. Working with Visual Studio.NET Web Applications
  9. Whats New in ASP.NET 2.0
  10. Creating an ASP.NET Application
  11. ASP.NET Code Directory
  12. ASP.NET Page Object Model
  13. ASP.NET Server Controls
  14. ASP.NET Working With Master Pages
  15. ASP.NET Creating Content for Master Page
  16. ASP.NET Referencing Master Page Members
  17. ASP.NET Changing Master Pages Dynamically
  18. ASP.NET Creating Nested Master Pages
  19. ASP.NET Working with Web Parts
  20. ASP.NET Using Web Parts and Controls in Web Pages
  21. ASP.NET Web Pages and Layout
  22. ASP.NET - Adding Web Parts at Run Time
  23. ASP.NET Personalization: User Profiles and Themes
  24. ASP.NET Data Access features
  25. ASP.NET State Management
  26. ASP.NET Customizing the Session State Mechanism
  27. ASP.NET State Management And Caching
  28. ASP.NET Security
  29. Forms Authentication in ASP.NET
  30. ASP.NET Managing Membership and Roles
  31. ASP.NET Configuring Page-Level Caching
  32. ASP.NET Setting Application-Level Caching
  33. ASP.NET Data Source Object Model
  34. ASP.NET SqlDataSource Control
  35. ASP.NET Data Bound Controls
  36. ASP.NET GridView Control
  37. ASP.NET GridView Filtering
  38. ASP.NET Adding Sorting and Paging in GridView
  39. ASP.NET DataBound Controls - Details View
  40. ASP.NET Using a Grid to Display Detail Information
  41. ASP.NET Displaying Master-Detail Data on the Same Page
  42. Displaying Master-Detail Data on Separate Pages in ASP.NET
  43. ASP.NET Creating Web Wizards
  44. ASP.NET : Dynamic Image control
  45. ASP.NET Advanced Site Functionality

Ads


Home arrow Technical Training arrow ASP.NET 2.0

Creating an ASP.NET Application Page - 2

Page 2 of 2
Author : Exforsys Inc.     Published on: 11th Aug 2005    |   Last Updated on: 21st Nov 2007

Creating an ASP.NET Application

.

.

Ads

In the above code nothing happens when we click on the “Greet” button. Let us write some code to make it do something. Add the following code between the form tags just below the code entered above:

 

 

The output appears as under:

Designing Web Forms

As noted in the above exercise it is easy to drag and drop controls directly from the toolbox into the form and the corresponding HTML can also be seen in the source view. The code for a specific control can be edited by highlighting it in the design view and navigating to the source view. Switching between the views also does not undo the editing of the HTML code.

The autocompletion feature kicks in the moment the developer enters a tag and ensures that the start and end tags are not forgotten by the user. Moving the cursor over a start tag highlights the corresponding end tag for the user. The HTML also is monitored for suitability to the browser which is targeted. The target browser is displayed at the top of the edit window. By default it is set to Internet Explorer 6.0. When a user types a wrong or deformed tag the incompatibility is immediately indicated. The client targets cover a wide gamut--Netscape navigator, mobile schemas, XHTML, transitional schema etc.

Note that in the above application when a button was placed on the form, the HTML code was modified to contain an additional onClick attribute

However this new version does not automatically provide the code for event write up. Event binding has to be done by the developer.

When the page is compiled for the first time the event is dynamically bound and the onclick attribute is expanded to the code displayed above. Note that instead of placing it in a separate file the code is defined as an event handler in the code-behind class.

Visual Studio.Net demands a web.config file as soon as an attempt is made to run the file, if it has not been generated. User’s have the option of ignoring the demand and clicking run or permitting the creation of the file. When the developer wants to debug the code by creating his own web.config file, he will have to define it. To make Visual Studio.NET 2005 generate the web.config add the following code.

< compilation debug= “true” / >

The debugging session can now begin.

The Embedded Web Server:

As mentioned in the earlier sections, Visual Studio.NET comes with an embedded server. This server does not have the features of the IIS but can run individual pages with ease. It does not have a metabase. It does not have an Simple Mail Transfer Protocol (SMTP) interface to enable it send emails, but this can be overcome by installing a separate SMTP service. In the context of security, the web server takes a token of the currently logged in user and executes the application. However, this makes for a testing environment that is significantly different from the real life scenario. Applications that work well in the local web server may fail when tested in the IIS. Therefore, it is recommended that though the local web server may be used for creating the pages, the ultimate tests should be conducted with the IIS>

Ads

Important folders in the ASP.NET 2.0 Applications

Folder names are case sensitive in ASP.NET 2.0. Data and Image folders do not play a significant role in the runtime architecture. Yet other folders like Bin, Code, Resources and themes are very important. The Bin folder contains all the precompiled assemblies that the application needs. The Code folder contains source class files that the ASP.NET runtime engine dynamically compiles to assemblies. The Resources folder contains resource files that are required for compiling the assemblies. The Themes folder defines the themes that are supported by the application. They are dynamically compiled to a dynamic assembly.

This section of the tutorial has introduced the basic concepts of the ASP.NET application and also examined how the traditional ‘Hello World’ application can be created using the interface available. In the next few sections of this tutorial we shall be examining the other significant features of ASP.NET and also learning how to use them in application design.



 
This tutorial is part of a ASP.NET 2.0 tutorial series. Read it from the beginning and learn yourself.

ASP.NET 2.0

  1. Getting started with ASP.NET 2.0
  2. .NET Framework Fundamentals
  3. Microsoft.NET Framework Tools
  4. Application Development in .NET
  5. What's New in the .NET Framework 2.0 ?
  6. Introduction to Visual Studio.NET
  7. Installing Visual Studio.NET 2005
  8. Working with Visual Studio.NET Web Applications
  9. Whats New in ASP.NET 2.0
  10. Creating an ASP.NET Application
  11. ASP.NET Code Directory
  12. ASP.NET Page Object Model
  13. ASP.NET Server Controls
  14. ASP.NET Working With Master Pages
  15. ASP.NET Creating Content for Master Page
  16. ASP.NET Referencing Master Page Members
  17. ASP.NET Changing Master Pages Dynamically
  18. ASP.NET Creating Nested Master Pages
  19. ASP.NET Working with Web Parts
  20. ASP.NET Using Web Parts and Controls in Web Pages
  21. ASP.NET Web Pages and Layout
  22. ASP.NET - Adding Web Parts at Run Time
  23. ASP.NET Personalization: User Profiles and Themes
  24. ASP.NET Data Access features
  25. ASP.NET State Management
  26. ASP.NET Customizing the Session State Mechanism
  27. ASP.NET State Management And Caching
  28. ASP.NET Security
  29. Forms Authentication in ASP.NET
  30. ASP.NET Managing Membership and Roles
  31. ASP.NET Configuring Page-Level Caching
  32. ASP.NET Setting Application-Level Caching
  33. ASP.NET Data Source Object Model
  34. ASP.NET SqlDataSource Control
  35. ASP.NET Data Bound Controls
  36. ASP.NET GridView Control
  37. ASP.NET GridView Filtering
  38. ASP.NET Adding Sorting and Paging in GridView
  39. ASP.NET DataBound Controls - Details View
  40. ASP.NET Using a Grid to Display Detail Information
  41. ASP.NET Displaying Master-Detail Data on the Same Page
  42. Displaying Master-Detail Data on Separate Pages in ASP.NET
  43. ASP.NET Creating Web Wizards
  44. ASP.NET : Dynamic Image control
  45. ASP.NET Advanced Site Functionality
 

Comments