Based on Tomas advice. I made this working. Thanks to all the guys who helped in this.
If (txtSInvoice.Text.Length > 0) Or Not (String.IsNullOrEmpty(txtFromDate.Text) AndAlso String.IsNullOrEmpty(txtToDate.Text)) Then
ScriptManager.RegisterClientScriptBlock(TryCast(sender, Control), Me.GetType(), "alert", "Hello Search", True)
Else
ScriptManager.RegisterClientScriptBlock(TryCast(sender, Control), Me.GetType(), "alert", "Please enter Criteria for Search", True)