当前位置:文档之家› 实验室管理系统开题报告

实验室管理系统开题报告

zzzz学院本科毕业论文(设计)任务书说明1. 本表需在指导教师和有关领导审查批准的情况下,要求学生认真填写。

2. 课题来源分为教师提供选题或学生自拟课题;教师的科研任务;社会有关单位委托的课题;其他来源。

3. 若课题因故变动时,应向指导教师提出申请,提交题目变动论证报告。

学院本科毕业论文文献综述外文文献翻译原文:Performing Form Validation with Validation ControlsUsing Client-side ValidationTraditionally, Web developers have faced a tough choice when adding form validation logic to their pages. You can add form validation routines to your server-side code, or you can add the validation routines to your client-side code.The advantage of writing validation logic in client-side code is that you can provide instant feedback to your users. For example, if a user neglects to enter a value in a required form field, you can instantly display an error message without requiring a roundtrip back to the server.People really like client-side validation. It looks great and creates a better overall user experience. The problem, however, is that it does not work with all browsers. Not all browsers support JavaScript, and different versions of browsers support different versions of JavaScript, so client-side validation is never guaranteed to work.For this reason, in the past, many developers decided to add all their form validation logic exclusively to server-side code. Because server-side code functions correctly with any browser, this course of action was safer.Fortunately, the Validation controls discussed in this chapter do not force you to make this difficult choice. The Validation controls automatically generate both client-side and server-side code. If a browser is capable of supporting JavaScript, client-side validation scripts are automatically sent to the browser. If a browser is incapable of supporting JavaScript, the validation routines are automatically implemented in server-side code.You should be warned, however, that client-side validation works only with Microsoft Internet Explorer version 4.0 and higher. In particular, the client-side scripts discussed in this chapter do not work with any version of Netscape Navigator.Requiring Fields: The RequiredFieldValidator ControlYou use RequiredFieldValidator in a Web form to check whether a control has a value. Typically, you use this control with a TextBox control. However, nothing is wrong with using RequiredFieldValidator with other input controls such as RadioButtonList.Validating Expressions: The RegularExpressionValidator ControlYou can use RegularExpressionValidator to match the value entered into a form field to a regular expression. You can use this control to check whether a user has entered, for example, a valid e-mail address, telephone number, or username or password. Samples ofhow to use a regular expression to perform all these validation tasks are provided in the following sections.Comparing Values: The CompareValidator ControlThe CompareValidator control performs comparisons between the data entered into a form field and another value. The other value can be a fixed value, such as a particular number, or a value entered into another control.Summarizing Errors: The ValidationSummary ControlImagine that you have a form with 50 form fields. If you use only the Validation controls discussed in the previous sections of this chapter to display errors, seeing an error message on the page might be difficult. For example, you might have to scroll down to the 48th form field to find the error message.Fortunately, Microsoft includes a ValidationSummary control with the Validation controls. You can use this control to summarize all the errors at the top of a page, or wherever else you want./view/2d679fed941ea76e58fa04b6.html 译文:用验证控件做页面验证使用客户端验证传统地,当增加验证到他们的页面中时,他们会面临一个严峻的选择。

你可以添加窗体页面验证规则到你的服务器端代码,或者是添加验证规则到你的客户端代码。

写验证代码到客户端代码中的优势能够及时反馈到你的用户。

举例来说,一个使用者忽略在一个要求检验的字段中输入一个值,你能够及时的显示一个错误信息而不需要返回到服务器端解决。

人们喜欢客户端的验证。

它看起来很棒而且产生一种比较好的效果。

然而,问题是它不与所有的浏览器兼容。

不是所有的浏览器支持 JavaScript、不同版本的浏览器的不同版本支持JavaScript,所以客户端验证没有保障。

由于这个原因,许多开发者在过去决定添加自定义验证到服务器端。

因为服务器端代码能够和任何浏览器协同工作。

就这样的做法更有安全的保障。

幸运地,正如在章节讨论的这些验证控件不会强迫你做困难的选择。

这些验证控件会自动地产生客户端代码和服务器端代码。

如果一个浏览器有能力支持JavaScript ,客户端的验证脚本将会自动返回到浏览器。

如果一个浏览器不支持 JavaScript,那个验证规则会自动在服务器端代码中执行。

然而你需要注意的是,客户端的验证仅仅能够工作在IE4.0或更高的版本。

尤其,客户端脚本不可能在任意版本的浏览器中运行。

控制字段: RequiredFieldValidator 控件你用这个控件来检查在一个Web窗体中是否为空,典型地,你和 TextBox 控件一起使用这个控件。

然而,这个控件也可以用在其他的输入型控件,例如:RadioButtonList.控件。

验证表达式: RegularExpressionValidator 控件你能使用 RegularExpressionValidator 控件来验证输入的值是否和定义的正则表达式相匹配。

例如:你能使用这控件来检查一个用户是否输入一个合法的电子邮件地址,电话号码,用户名或密码。

怎样用一个正则表达式来完成这些验证任务将会在下面的例子中一一列出。

相关主题