Customize in WEB programs, fault tolerance prompt window

Source: Internet
Author: User
Tags trim
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 ");

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.