If statements in aspx pages

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What is wrong with the following if statement in my aspx page?

<%If #DataBinder.Eval(Container.DataItem, "locationType") <> "T" Then%>

I get error that says: BC30201: Expression expected.
 
Try

<%# Iff(DataBinder.Eval(Container.DataItem, "locationType") <> "T",
True_Part, False_part) %>

HTH

Elton Wang
(e-mail address removed)
 
Actually I mean

<%# IIf(DataBinder.Eval(Container.DataItem, "locationType") <> "T",
True_Part, False_part) %>

Elton
 
binding expressions can not be used in statement block <% %>, just as
statements can not be used in a binding expression block <%# %>

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top