| Author |
Topic Search Topic Options
|
Misty
Senior Member
Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
|
Post Options
Thanks(0)
Quote Reply
Topic: Needs Help with Container.DataItem Posted: 04 November 2004 at 8:05pm |
I cannot figure out where I am supposed to put a ) for
<%# IIF(FieldValueIsMissing(Container.DataItem("WebSite")), "", "<a href='" & (Container.DataItem("WebSite") & "'>Go To Web Site</a>", "")%>.
I got the following error message: BC30198: ')' expected.
I tried adding a ) to several places. It would not work. Can you please help me figure out where the ) should be?
Edited by Misty
|
 |
Phat
Senior Member
Joined: 23 February 2003
Status: Offline
Points: 386
|
Post Options
Thanks(0)
Quote Reply
Posted: 04 November 2004 at 9:39pm |
Misty wrote:
<%# IIF(FieldValueIsMissing(Container.DataItem("WebSite")), "", "<a href='" & (Container.DataItem("WebSite")) & "'>Go To Web Site</a>", "")%>.
|
I think
|
 |
Misty
Senior Member
Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
|
Post Options
Thanks(0)
Quote Reply
Posted: 04 November 2004 at 9:43pm |
That didn't work. I had tried that before. I got the following error message: BC30057: Too many arguments to 'Public Function IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) As Object'.
It's obviously a problem with the syntax somewhere. I tried putting another ) at the end, but it didn't work. I got the error message about needing ).
Here's the function that I am using: Function FieldValueIsMissing(objValueToCheck As Object) As Boolean
if objValueToCheck is DBNull.Value Then return True else return False end if End Function
Edited by Misty
|
 |
Leeb65
Groupie
Joined: 05 December 2003
Location: Germany
Status: Offline
Points: 62
|
Post Options
Thanks(0)
Quote Reply
Posted: 05 November 2004 at 2:22am |
<%# IIF(FieldValueIsMissing(Container.DataItem("WebSite")), "", "<a href='" & Container.DataItem("WebSite") & "'>Go To Web Site</a>")%>
That should work.
|
Lee
|
 |
Phat
Senior Member
Joined: 23 February 2003
Status: Offline
Points: 386
|
Post Options
Thanks(0)
Quote Reply
Posted: 05 November 2004 at 2:24am |
|
it may not be a ) becasue of the ' and " in there it make it a bit hard. Try stripping it back to
<%# IIF(FieldValueIsMissing(Container.DataItem("WebSite")), "One", "Two", "")%>.
You may have too many , in there.
it should be IIf(expression, truepart, falsepart)
I thnink you have IIf(expression, truepart, falsepart,extra part)
try
<%# IIF(FieldValueIsMissing(Container.DataItem("WebSite")), "One", "Two")%>.
or
<%# IIF(FieldValueIsMissing(Container.DataItem("WebSite")), "", "<a href='" & (Container.DataItem("WebSite")) & "'>Go To Web Site</a>")%>.
|
 |
Mart
Senior Member
Joined: 30 November 2002
Status: Offline
Points: 2304
|
Post Options
Thanks(0)
Quote Reply
Posted: 05 November 2004 at 2:52am |
This code definatley works, tweak it to yours:
<%# IIf(Databinder.Eval(Container.DataItem, "Popularity") > (New Devjunkies_Link_Manager.SettingsProvider).HotLimit, " <span class='hot'>Hot!</span>", String.Empty) %>
|
 |
Misty
Senior Member
Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
|
Post Options
Thanks(0)
Quote Reply
Posted: 05 November 2004 at 1:26pm |
I forgot to mention that I cannot use Databinder.Eval for this particular DataList. The line of code: <%# IIF(FieldValueIsMissing(Container.DataItem("WebSite")), "", "<a href='" & Container.DataItem("WebSite") & "'>Go To Web Site</a>")%>
that Leeb65 gave worked.
|
 |