[Webinar] Streamline your web hosting managementRegister Today


Simple IIF problem  - When using IIF within asp.net

Posted on 2008-02-06
Medium Priority
Last Modified: 2013-11-07
I want to show a link if the propLevel = 1
I want to just show the name if the prop level does not = 1

I'm close... but not there

<%#IIf(Eval("propLevel") = 1, "<a href="<%# Eval("dbName") %>/<%# Eval("dbName") %>.aspx?Accommodation=<%# Eval("id") %>"><%# Eval("Name") %></a>", "<%# Eval("Name") %>)%>

where am i going wrong?
Question by:nickrjsmith
LVL 43

Accepted Solution

TimCottee earned 2000 total points
ID: 20831010
Not enough quotes and too many <%# / %>

<%#IIf(Eval("propLevel") = 1, "<a href=""" & Eval("dbName") & "/" & Eval("dbName") & ".aspx?Accommodation=" & Eval("id") & """>" & Eval("Name") & "</a>", Eval("Name") )%>

Open in new window


Author Closing Comment

ID: 31428436
Excellent - many thanks.. i though that but couldn;t work it therough

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

591 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question