First, design a fault tolerance Prompt window image as follows:
The key HTML text is as follows:
"Reason: <% = content [Int32.Parse (Request. QueryString [" ms "])] %>"
Then add the following in the code editing window:
Public class WebForm1: System. Web. UI. Page
{
Public string [] content;
Private void Page_Load (object sender, System. EventArgs e)
{
Content = new string [10];
Content [1] = ". Prompt 1 .";
Content [2] = "prompt 2 ";
......
}
========================================================== ===
In a fault-tolerant webpage, call the following method:
[/* The following is an example! */]
Public void Check ()
{// Check the legality of user input;
// Check whether the [order number] [type] is blank;
If (lOrderName. InnerText. Trim () = "" | lOrderCategory. InnerText. Trim () = "")
{
Response. Redirect (@ "... Exceptions. aspx? MS = 11 ");
}
// Determine whether the number entered by the user is correct;
Try
{
Int I = Convert. ToInt16 (tbQuantity. Text );
If (I = 0)
{
Response. Redirect (@ "... Exceptions. aspx? MS = 12 ");
}
}
Catch
{
Response. Redirect (@ "... Exceptions. aspx? MS = 12 ");
}
// Determine whether the date is correct;
Try
{
Convert. ToDateTime (tbTerm. Text );
}
Catch
{
Response. Redirect (@ "... Exceptions. aspx? MS = 9 ");
}
// Determine that the delivery date must be later than the billing date;
If (Convert. ToDateTime (tbTerm. Text) <Convert. ToDateTime (Request. Cookies ["Order"]. Values ["Date"])
{
Response. Redirect (@ "... Exceptions. aspx? MS = 14 ");