473,387 Members | 1,624 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

If statements in aspx pages

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.
Nov 19 '05 #1
3 6949
Try

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

HTH

Elton Wang
el********@hotmail.com
"Jason" wrote:
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.

Nov 19 '05 #2
Actually I mean

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

Elton

"Jason" wrote:
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.

Nov 19 '05 #3
binding expressions can not be used in statement block <% %>, just as
statements can not be used in a binding expression block <%# %>

-- bruce (sqlwork.com)


"Jason" <Ja***@discussions.microsoft.com> wrote in message
news:23**********************************@microsof t.com...
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.

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Paul | last post by:
Title: What are the Consequences of Aspx page separate from app DLL Hi JL; I am working on a big asp.net application. When we migrate the dll (or dlls) to the production server, all users who are...
4
by: mglover | last post by:
i have a .html page that uses include statements for a header and footer that i have to rebuild in .net (.aspx pages) i am very new to .net and i do not know how if .net supports include...
7
by: J Smithers | last post by:
I have several ASPX pages (with code-behind logic) that I reuse amongst many Web sites on the same production server. Currently each Web site has its own copy of these aspx pages. I was thinking...
2
by: Janusz Jezowicz | last post by:
Hello! I would like to have one page on the server, which would be a target processing page for a number of other aspx pages. E.g Processing page \portal_page.aspx Target pages
29
by: John Rivers | last post by:
Hello, What good reason there is for not allowing methods in ASPX pages I can't imagine, but here is how to get around that limitation: (START) <body MS_POSITIONING="FlowLayout"> <form...
10
by: ptass | last post by:
Hi In asp.net 2.0 an aspx files .cs file is a partial class and all works fine, however, I thought I’d be able to create another class file, call it a partial class and have that compile and...
3
by: Mike Dee | last post by:
I posted this back in November 2005 a couple times but did not get any responses. I'm hoping someone here can please shed some light on this. I'm new to index server and can't get any DocTitle...
13
by: Matt | last post by:
Does anyone know how to hide the ASPX extension of web pages in ASP.Net 2.0? Thanks, Matt
13
by: Bob Jones | last post by:
Here is my situation: I have an aspx file stored in a resource file. All of the C# code is written inline via <script runat="server"tags. Let's call this page B. I also have page A that contains...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.