Searching a database
So that's the whole code. Now, go to Default.aspx
and write some code that's similar to what you've written before, but more sophisticated. You can search for cars, for example, just as you did before.
Go to Toolbox
and drag a Button
control below the line that begins with <form id...
, as follows:
<asp:Button ID="Button1" runat="server" Text="Get Inventory" /><br />
Change the Text
property on the Button
control to say "Get Inventory"
, as if you're getting this information from a database--that's the experience we're simulating here. (You can delete the div lines; we don't need them.)
If you go to the Design
view, you will see a simple button:

Figure 6.15.4: Our interface includes a simple button
Now left double-click on the Get Inventory
button, which will bring up the Event Handler for it. (You can get rid of the Page_Load
block.) The starting portion of Default.aspx.cs
with which we shall begin work is shown in the following screenshot:

Figure 6.15.5: The...