If dataitem is Null I want to show 0
<asp:Label ID="Label18" Text='<%# Eval("item") %>' runat="server"></asp:Label>
How can I accomplish this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can also create a public method on the page then call that from the code-in-front.
e.g. if using C#:
Then the label in the code-in-front will be something like:
Sorry, haven’t tested this code so can’t guarantee I got the syntax of “
<%# ProcessMyDataItem(Eval("item")) %>” entirely correct.