以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  判断这二个文本框中任何一个为空  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=20374)

--  作者:飞天
--  发布时间:2012/6/6 17:13:00
--  判断这二个文本框中任何一个为空
 请问在窗口中有:TextBox1和TextBox2
当点击保存按钮时,判断这二个文本框中任何一个为空.则提示,否则不提示.应该如何写
判断一个文本框是否为空是:
Dim tx1 As String = e.Form.Controls("TextBox1").Value
If tx1 = "" Then


判断二个的话,应该怎么写?

--  作者:狐狸爸爸
--  发布时间:2012/6/6 17:30:00
--  

Dim tx1 As String = e.Form.Controls("TextBox1").Value

Dim tx2 As String = e.Form.Controls("TextBox2").Value
If tx1 = "" OrElse tx2 = ""  Then

End If

 

更好的办法:

 

if e.Form.Controls("TextBox1").Value Is Nothing OrElse   e.Form.Controls("TextBox1").Value Is Notning Then

End if