Dansko_chkbx.Vi sible = false;
ProductDetailTa bleAdapter productadp = new
ProductDetailTa bleAdapter();
DataTable productdatatabl e =
productadp.GetD anskoProductDet ailById(Convert .ToInt32(Orderi d.ToString()));
foreach (DataRow ProductDataRow in productdatatabl e.Rows)
{
DanskoPrice =
Convert.ToDecim al(ProductDataR ow["Price"].ToString());
Danskobrandname =
ProductDataRow["BrandName"].ToString();
if ((Danskobrandna me.Contains("Da nsko")) &&
(DanskoPrice 100))
{
Dansko_chkbx.Vi sible = true;
}
else
{
Dansko_chkbx.Vi sible = false;
}
}
On Apr 10, 10:35*am, "Ignacio Machin ( .NET/ C# MVP )"
<ignacio.mac... @gmail.comwrote :
On Apr 9, 5:26*pm, duncfair <duncf...@gmail .comwrote:
What I have is pretty much what you wrote, but my the visible=true vs
visible=false is only 'looking at' the last item in the cart. Even if
I have an item that meets the criteria, if it's not the last item
added to the cart the checkbox is not visible.
On Apr 9, 12:52*pm, "Ignacio Machin ( .NET/ C# MVP )"
<ignacio.mac... @gmail.comwrote :
On Apr 9, 2:03*pm, duncfair <duncf...@gmail .comwrote:
asp.net 2.0 and language is c#
I need to add a single checkbox on an aspx page based on evaluating
two aspects of the items the customer has placed in the shopping cart.
The price must be $100 or more and the brand must be a specific brand.
There may be multiple items in the cart but there can be only one
checkbox. *I wrote some code on the codebehind, but it only evaluates
the last item in the cart. *How can I evaluate all o the items?
Thanks in advance for any help.
What did you write?
ni the code behind you should do something like:
bool isVisible = false;
foreach(Item item in Cart.Items)
* if ( item. ..... condition)
*{
* isVisible = true;
break;}
checkBox1.Vislb le = isVisible;- Hide quoted text -
- Show quoted text -
can you post your code?
maybe you confused "=" with "=="- Hide quoted text -
- Show quoted text -