The code on page 122 in the c# Book is missing opening CurlyQ on the if (IsPostBack) line. I assume your problem is with TIO #1.
The code below works. Place it inside of the <script> tags.
This should be confirmed and moved to the erata page?
Code:
void Page_Load()
{
if (IsPostBack)
{
DateTime datInput;
datInput = Convert.ToDateTime(txtIn.Text);
if (
datInput >=Convert.ToDateTime("1/1/2005")
&&
datInput <=Convert.ToDateTime("12/31/2005")
)
lblOut.Text = "Date inside year 2005." + datInput;
}
}
Is your problem something else?
Hal Levy
Web Developer, PDI Inc.
NOT a Wiley/Wrox Employee