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(dgSearchAddr esses.Items.Cou nt == 0)
{
this.pnlSearchA ddresses.Visibl e = false;
}
//******** else if(alSearchaddr ess[0] == test)********//
{
this.pnlSearchA ddresses.Visibl e = false;
}
else
{
this.pnlSearchA ddresses.Visibl e = true;
this.lblMessage .Text = "";
}
}
Arraylist is being created like so: -
Address newAddress = new Address();
newAddress.Addr ess1 = "Address not supplied";
newAddress.Addr ess2 = null;
newAddress.Addr ess3 = " ";
newAddress.Addr ess4 = null;
newAddress.Addr ess5 = null;
newAddress.Addr ess6 = 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(dgSearchAddr esses.Items.Cou nt == 0)
{
this.pnlSearchA ddresses.Visibl e = false;
}
//******** else if(alSearchaddr ess[0] == test)********//
{
this.pnlSearchA ddresses.Visibl e = false;
}
else
{
this.pnlSearchA ddresses.Visibl e = true;
this.lblMessage .Text = "";
}
}
Arraylist is being created like so: -
Address newAddress = new Address();
newAddress.Addr ess1 = "Address not supplied";
newAddress.Addr ess2 = null;
newAddress.Addr ess3 = " ";
newAddress.Addr ess4 = null;
newAddress.Addr ess5 = null;
newAddress.Addr ess6 = null;
Comment