Dansko_chkbx.Visible = false;
ProductDetailTableAdapter productadp = new
ProductDetailTableAdapter();
DataTable productdatatable =
productadp.GetDanskoProductDetailById(Convert.ToIn t32(Orderid.ToString()));
foreach (DataRow ProductDataRow in productdatatable.Rows)
{
DanskoPrice =
Convert.ToDecimal(ProductDataRow["Price"].ToString());
Danskobrandname =
ProductDataRow["BrandName"].ToString();
if ((Danskobrandname.Contains("Dansko")) &&
(DanskoPrice 100))
{
Dansko_chkbx.Visible = true;
}
else
{
Dansko_chkbx.Visible = 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.Vislble = isVisible;- Hide quoted text -
- Show quoted text -
can you post your code?
maybe you confused "=" with "=="- Hide quoted text -
- Show quoted text -