stooicrealism
stooicrealism

Reputation: 558

How to stop control creation inside a repeater based on a condtition?

Here is the control i want to be created only if the condition is true. How do I do that using say the "Visible" attribute or something easy like that?

 <p><%# (GetAnswer(Eval("AnsQID"))) != 1 ? (Eval("AText")) : ""%></p>

Upvotes: 0

Views: 74

Answers (1)

sq33G
sq33G

Reputation: 3360

<asp:Label ID="lblAnswer" Text='<%# GetAnswer(Eval("AnsQID")) != 1 ? (Eval("AText")) : "" %>' Visible='<%# YourMethodHere() %>' />

Upvotes: 2

Related Questions