Database Reference
In-Depth Information
Understanding the Web UI of ASP.NET Web Apps
The UI of an ASP.NET application or web site is a web form or web page with an extension of .aspx ,
which means Active Server Pages.
Each web form or web page will contain the UI design or presentation in HTML format and the code
functionality in an associated code-behind file with an extension of .cs . Hence, if your form is
Default.aspx , this represents the presentation, and the Default.aspx.cs file represents the code. You
will work with these files later in this chapter. Unlike the old version of ASP known as classical ASP, this
approach helps keep the presentation separate from the logic and makes it easy to work with for a
developer.
Also, as shown in previous chapters, ASP.NET-based applications are capable of containing multiple
pages. You make one form the default page to load an application with, and then you move between the
pages. Unlike Windows Forms, ASP.NET uses a different mechanism to switch to another form after an
acknowledgment of an event. The mechanism is known as redirect , and this is available under the
Response object of ASP.NET. Later in this chapter, you will see how these most widely used functions and
objects work together.
Try It: Working with a Web Form
In this exercise, you will add a web form with basic controls to your project, and then you will add the
required functionality to the controls.
1. Navigate to Solution Explorer, select the Chapter16 project, right-click it, and
select Add New Item.
2. In the Add New Item dialog box, modify the form name to appear as Login,
and ensure that the Language drop-down list shows Visual C#. Click OK to add
the Login form to your project.
3. Right-click the Login.aspx web form, and select the View Designer option; this
will open the Login.aspx page in the Design view, where you can drag and
drop controls onto the web page, as shown in Figure 16-5.
 
Search WWH ::




Custom Search