<%#String.Format("~/storefront.aspx?CatalogID={0}&ProductID={1}", Eval("CatalogID"), Eval("ProductID"))%>
what I am trying to do is:
NavigateUrl='<%#String.Format("~/storefront.aspx?CatalogID={0}&ProductID={1}",Eval("CatalogID"), (Eval("CatalogID")=="856" ? Eval("ProductID") : Eval("CustItem")))%>
I'm trying to link back to the item from a page.. and I have accomplished this for every item except the ones in catalogid 856 ...the url looks like: storefront.aspx?CatalogID=856&ProductID=AVE05418 that example is of one from catalog 856, problem is, is the productid being passed in the url is actually the a variable called CustItem so Im trying to pass the CustItem in the place of ProductID when the catalog is 856
Thank you
You can try something like this:
Eval("CatalogID") == 856 ? Eval("CustItem") : Eval("ProductID")
EDIT
NavigateUrl='<%#String.Format("~/storefront.aspx?CatalogID={0}&ProductID={1}",Eval("CatalogID"), (Eval("CatalogID").ToString() == "856" ? Eval("CustItem") : Eval("ProductID")))%>'
You could use a ternary operator.
Eval((CatalogID==856) ? "CustItem" : "ProductID")
Way better than that would be fixing the bad data that's found its way into your database so you could avoid this ugliness in the first place.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With