Condition in ASP Repeater
Posted
by Abdel Olakara
on Stack Overflow
See other posts from Stack Overflow
or by Abdel Olakara
Published on 2010-06-09T13:34:59Z
Indexed on
2010/06/09
13:42 UTC
Read the original article
Hit count: 421
Hi all,
I am trying to put a condition into my ASP repeater tag. I have a table being created and one of the td items is a link. The problem is I need to create a link upon checking the value in one the variable that is in the repeater container. Here is my code:
<td><%#((VWApp.Code.TrackDM)Container.DataItem).CdNo%></td>
<td><%#((VWApp.Code.TrackDM)Container.DataItem).ShippingNo%></td>
Now i need to check the value of ShippingNo and rather than displaying it need to display a link. i tried to write an if condition like this:
if(((VWApp.Code.TrackDM)Container.DataItem).ShippingNo. .. )
{
// do processing and generate a link that needs to displayed
}
But i get error when trying to do this. Can anybody guide me to the right way of doing this?
Any ideas and suggests are highly appreciated.
© Stack Overflow or respective owner