This chapter has seen us dabble with
ASP.NET code for the first time. While some of the examples might have seemed
quite repetitive, it is necessary to be comfortable with how you go about
handling all the different HTML server controls, as they will crop up
frequently and we won't spend any time going back over how they work.
the ASP.NET server controls in preference to using the HTML form controls, and
demonstrated that the server-side counterparts of many of the HTML form
controls offer extra functionality over their client-side counterparts. In
particular, we saw how we could use the <asp:label> control to display text and how we could use the
other controls such as <asp:dropdownlist>, <asp:textbox>, and <asp:radiobutton> in place of HTML form controls.
In our next
chapter, we will look at how we can store information within our ASP.NET pages,
1. Explain the difference between an HTML form and a web form.
Explain the difference between <form> and <form runat="server"> and describe how each one is handled.
Personalize the following birthday
message to the President by adding your own name and unique gift within the <script>...</script> blocks. You may want to save and run this code first to see what
you're aiming for:
<br /><br />
<br /><br />
<asp:label id="Message1" runat="server"
wish you many happy returns. Enjoy the
<asp:label id="Message2" runat="server"
4. Modify the example you just created to give the President a list of
three birthday present choices to choose from. Use the <asp:checkbox> control to do this. Include a Submit button so the President knows which presents he has chosen.