View Full Version : ASP if... then... not showing fresh content in table
fleurdelisgrrl
08-11-2004, 12:13 PM
i have a problem with a table that is listing variables pulled from a sql server. part of that table is checking the codes of a product (checks) and if the last two digits of that product are a specific two digits it then determines what text will show. problem is... it seems that the code is not checking for the last two digits, and instead is just repeating table cells down the column what the first if... then... determines.
<%if right(session("MyShoppingCart")(1,i),2)="S7" then Response.Write("Single") else Response.Write("Duplicate")%>
here's the line of code i'm working with. any ideas?
tommy
08-21-2004, 04:58 AM
i have a problem with a table that is listing variables pulled from a sql server. part of that table is checking the codes of a product (checks) and if the last two digits of that product are a specific two digits it then determines what text will show. problem is... it seems that the code is not checking for the last two digits, and instead is just repeating table cells down the column what the first if... then... determines.
<%if right(session("MyShoppingCart")(1,i),2)="S7" then Response.Write("Single") else Response.Write("Duplicate")%>
here's the line of code i'm working with. any ideas?
if all the checking codes are the same length you could could possibly do the following.
in this example your code is: 123456789ab78
and you want to check the last three characters(b78)
if mid(session("MyShoppingCart"),11,3) = "b78" then
Response.write "Single"
else
Response.write "Duplicate"
end if
hope this helps
tom
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.