G
Guest
Im trying to carry work out an else if clause in the below method but i'm
having a lot of difficulty getting the correct code which allows me to check
and see if an arraylist items has text in it containing Address not supplied.
Im trying to do something below but its not working properly. Can someone
help me do this please. the code i use is below.
private void checkArrayList()
{
ArrayList alSearchaddress;
alSearchaddress = (ArrayList) ViewState["Addresses"];
string test = "Address not supplied";
if(dgSearchAddresses.Items.Count == 0)
{
this.pnlSearchAddresses.Visible = false;
}
//******** else if(alSearchaddress[0] == test)********//
{
this.pnlSearchAddresses.Visible = false;
}
else
{
this.pnlSearchAddresses.Visible = true;
this.lblMessage.Text = "";
}
}
Arraylist is being created like so: -
Address newAddress = new Address();
newAddress.Address1 = "Address not supplied";
newAddress.Address2 = null;
newAddress.Address3 = " ";
newAddress.Address4 = null;
newAddress.Address5 = null;
newAddress.Address6 = null;
having a lot of difficulty getting the correct code which allows me to check
and see if an arraylist items has text in it containing Address not supplied.
Im trying to do something below but its not working properly. Can someone
help me do this please. the code i use is below.
private void checkArrayList()
{
ArrayList alSearchaddress;
alSearchaddress = (ArrayList) ViewState["Addresses"];
string test = "Address not supplied";
if(dgSearchAddresses.Items.Count == 0)
{
this.pnlSearchAddresses.Visible = false;
}
//******** else if(alSearchaddress[0] == test)********//
{
this.pnlSearchAddresses.Visible = false;
}
else
{
this.pnlSearchAddresses.Visible = true;
this.lblMessage.Text = "";
}
}
Arraylist is being created like so: -
Address newAddress = new Address();
newAddress.Address1 = "Address not supplied";
newAddress.Address2 = null;
newAddress.Address3 = " ";
newAddress.Address4 = null;
newAddress.Address5 = null;
newAddress.Address6 = null;