Guest User

Guest User

  • Tech Writer
  • 26
  • 3.9k

What can be my if statement?

Aug 23 2018 3:46 AM
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
private bool IsFilled()
{
if (TextBox1.Text == "" || TextBox2.Text == "" || TextBox3.Text == "")
{
if (TextBox1.Text == "")
{
Label1.Visible = true;
}
else
Label1.Visible = false;
{
}
if (TextBox2.Text == "")
{
Label2.Visible = true;
}
else
Label2.Visible = false;
{
}
if (TextBox3.Text == "")
{
Label3.Visible = true;
}
else
Label3.Visible = false;
{
}
return true;
}
else
{
Label1.Visible = false;
Label2.Visible = false;
Label3.Visible = false;
return false;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
if (IsFilled())
{
//what can be my if statement?
}
else
{
//what can be my else statement?
//like im going to state here that its already successful? 
}
}
}

Answers (5)