C#中验证控件的使用方法总结(续前篇)
2009-07-29 11:34
525 查看
[align=left]C [/b]还可以通过这种方式验证[/b][/align]
[align=left]示例代码如下:[/align]
[align=left] [/align]
private void btnOK_Click(object sender, EventArgs e)
{
if (curemp != null)//修改员工
{
Employee emp = new Employee();
if (txtEmpName.Text == "" || txtMobilePhone.Text == "" ||
txtPhone.Text == "" || txtEmpCertType.Text == "" ||
txtEmpCertNum.Text == "" || txtDiscount.Text == "" ||
txtAddress.Text == "")
{
MessageBox.Show("填写完整信息", "提示");
return;
}
[align=left] [/align]
[align=left] 这种方式跟J2EE的客户端验证是很相似的。[/align]
[align=left]D [/b]总结[/b][/align]
[align=left]ASP.NET提供的输入验证全面,而且可操作化和友好性即强,可以大大增强代码的可重用率,对编程的标准化,工程化和后期的维护都带来了便利。[/align]
[align=left]示例代码如下:[/align]
[align=left] [/align]
private void btnOK_Click(object sender, EventArgs e)
{
if (curemp != null)//修改员工
{
Employee emp = new Employee();
if (txtEmpName.Text == "" || txtMobilePhone.Text == "" ||
txtPhone.Text == "" || txtEmpCertType.Text == "" ||
txtEmpCertNum.Text == "" || txtDiscount.Text == "" ||
txtAddress.Text == "")
{
MessageBox.Show("填写完整信息", "提示");
return;
}
[align=left] [/align]
[align=left] 这种方式跟J2EE的客户端验证是很相似的。[/align]
[align=left]D [/b]总结[/b][/align]
[align=left]ASP.NET提供的输入验证全面,而且可操作化和友好性即强,可以大大增强代码的可重用率,对编程的标准化,工程化和后期的维护都带来了便利。[/align]
相关文章推荐
- C#中验证控件的使用方法总结一
- C#验证控件及使用方法
- C#验证控件的使用方法
- C#验证控件的使用方法
- C#验证控件的使用方法
- C#各种验证控件的使用方法
- C#验证控件使用方法及常用正则表达式例析
- [ZT]C#验证控件的使用方法(RegularExpressionValidator)的使用
- C#验证控件的使用方法
- C#验证控件的使用方法
- 【转载】C#验证控件的使用方法(RegularExpressionValidator)的使用
- C#验证控件的使用方法
- C#验证控件的使用方法
- C#验证控件的使用方法
- C#验证控件的使用方法说明
- C#验证控件的使用方法
- C#语言中字符类char的使用方法(总结)
- C#使用checkedListBox1控件链接数据库的方法示例
- 【转载于百度空间】C# WinForm中的BackgroundWorker控件的使用方法
- C#中用Invoke调用控件方法和BeginInvoke线程使用方法