Setting up Visual C# to deal with a variable
Remember from the previous chapter that there's a Label
control involved; be sure that you have that up. Start by doing the following:
- Switch to the
Design
view, by clicking the button in the lower-left corner. Your screen should look like the one shown in the following screenshot:

Figure 2.3.1: Visual C# Design view
Note
If you are missing Toolbox
, remember to click on View
and then on Toolbox
(press Ctrl+Alt+X if you prefer to use key combinations), and then drag and drop Label
into the Design view.
- In the next stage, go back to the
Source
view. - Name it
sampLabel
as before. - Go into
Default.aspx.cs
on the right-hand side, as shown in the following screenshot:

Figure 2.3.2: Our Default.aspx.cs view
Variables represent change
The code that we are going to create will be very basic and deal with variables. The first question is, ultimately, why introduce a variable in the first place? This is an important aspect. It is usually based on an observation that...