Forum Discussion
jaakivask
Jul 12, 2023Copper Contributor
Trouble with WebForms app
Hello, I do not have access to the code-behind source file. This file is not existing in the deployed app. The aspx file contains next code fragment (this is working correctly), but very long...
PasildaData
Nov 27, 2023Copper Contributor
jaakivask Looks like you should be able to use somthing like this after your <strong> tag:
<%
string pvname = ((OrderProductVariant)Container.DataItem).ProductVariant.Name;
//...
%>then find/replace with the variable name.
A quick glance at the code suggests that the two ternery operators are testing the same thing and both rely on ((OrderProductVariant)Container.DataItem).ProductVariant.Product.TemplateId
If this is correct, than that part of the code could be more legible like this (I added the closing strong tag):
<%
string pvname = ((OrderProductVariant)Container.DataItem).ProductVariant.Name;
int pvtemplate = ((OrderProductVariant)Container.DataItem).ProductVariant.Product.TemplateId;
string display = (pvtemplate == 4 && (pvname == "Kuldne keskmine" || pvname == "Aukso vidurys" || pvname == "Luksuslik" || pvname == "Deluxe"))
? " GĖLIŲ VAZA"
: "";
%>
<strong><%# display%></strong>