By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,077 Members | 2,160 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,077 IT Pros & Developers. It's quick & easy.

What is wrong with this line?

P: n/a
Hello,

i want to display the image "icon-yes.gif" if a certain condition is true or the image "icon-no.gif" if it's false.

I have this line:
<td><img runat="server" src='<%# "..image/" & IIF(dataSetPerson.FieldValue("Author", Container) = "Yes", "icon-yes.gif" "icon-no.gif" %>'></td>
I get this error
Compiler Error Message: BC30455: Argument not specified for parameter 'FalsePart' of 'Public Function IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) As Object'.

Then i tryied to change the line to:
<td><img runat="server" src='<%# "..image/" & IIF(dataSetPerson.FieldValue("Author", Container) = "Yes", "icon-yes.gif", "icon-no.gif" %>'></td>

I keep having the same error.

Can somebody help me? I am using ASP.NET / VB.

Thank You,
Miguel


Nov 18 '05 #1
Share this Question
Share on Google+
13 Replies


P: n/a
NM
Hi,

"Miguel Dias Moura" <we****@27NOSPAMlamps.com> a écrit dans le message de news:O7**************@TK2MSFTNGP09.phx.gbl...
Hello,

i want to display the image "icon-yes.gif" if a certain condition is true or the image "icon-no.gif" if it's false.

I have this line:
<td><img runat="server" src='<%# "..image/" & IIF(dataSetPerson.FieldValue("Author", Container) = "Yes", "icon-yes.gif" "icon-no.gif" %>'></td>

You need to add coma between "icon-yes.gif" and "icon-no.gif"

<td><img runat="server" src='<%# "..image/" & IIF(dataSetPerson.FieldValue("Author", Container) = "Yes", "icon-yes.gif", "icon-no.gif") %>'></td>

Regards
Nov 18 '05 #2

P: n/a
Hi NM,

that's what i allready did. I wrote that in my first post. When i do that i get this message:
Compiler Error Message: BC30198: ')' expected.

Any idea?

Thanks,
Miguel
"NM" <NM****@hotmail.com> wrote in message news:us*************@TK2MSFTNGP09.phx.gbl...
Hi,

"Miguel Dias Moura" <we****@27NOSPAMlamps.com> a écrit dans le message de news:O7**************@TK2MSFTNGP09.phx.gbl...
Hello,

i want to display the image "icon-yes.gif" if a certain condition is true or the image "icon-no.gif" if it's false.

I have this line:
<td><img runat="server" src='<%# "..image/" & IIF(dataSetPerson.FieldValue("Author", Container) = "Yes", "icon-yes.gif" "icon-no.gif" %>'></td>

You need to add coma between "icon-yes.gif" and "icon-no.gif"

<td><img runat="server" src='<%# "..image/" & IIF(dataSetPerson.FieldValue("Author", Container) = "Yes", "icon-yes.gif", "icon-no.gif") %>'></td>

Regards

Nov 18 '05 #3

P: n/a
You need to close the parenthesis, because you have an opening paren for your IIF, but not a closing one.
"Miguel Dias Moura" <we****@27NOSPAMlamps.com> wrote in message news:O7**************@TK2MSFTNGP09.phx.gbl...
Hello,

i want to display the image "icon-yes.gif" if a certain condition is true or the image "icon-no.gif" if it's false.

I have this line:
<td><img runat="server" src='<%# "..image/" & IIF(dataSetPerson.FieldValue("Author", Container) = "Yes", "icon-yes.gif" "icon-no.gif" %>'></td>
I get this error
Compiler Error Message: BC30455: Argument not specified for parameter 'FalsePart' of 'Public Function IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) As Object'.

Then i tryied to change the line to:
<td><img runat="server" src='<%# "..image/" & IIF(dataSetPerson.FieldValue("Author", Container) = "Yes", "icon-yes.gif", "icon-no.gif" %>'></td>

I keep having the same error.

Can somebody help me? I am using ASP.NET / VB.

Thank You,
Miguel

Nov 18 '05 #4

P: n/a
Hi Miguel,

I think that the error is that you need a , and a )

<td><img runat="server" src='<%# "..image/" & IIF(dataSetPerson.FieldValue("Author", Container) = "Yes", "icon-yes.gif" , "icon-no.gif") %>'></td>

Why do you not write nice ASPX instead of a kind of coding ASP style in ASPNET, you have got some samples from me, using that it is easier to see where are the errrors?

Cor

Nov 18 '05 #5

P: n/a
* "Miguel Dias Moura" <we****@27NOSPAMlamps.com> scripsit:
<td><img runat="server" src='<%# "..image/" & IIF(dataSetPerson.FieldValue("Author", Container) = "Yes", "icon-yes.gif"
There is a ', ' missing here.
"icon-no.gif"
.... and a ')' here.
%>'></td>
I get this error

Compiler Error Message: BC30455: Argument not specified for parameter 'FalsePart' of 'Public Function IIf(Expression As Boolean,
TruePart As Object, FalsePart As Object) As Object'.


--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 18 '05 #6

P: n/a
What do you mean? How would you create this?
I am what would be the best way to do this?

Thanks,
Miguel
"Cor Ligthert" <no**********@planet.nl> wrote in message news:#Y**************@TK2MSFTNGP09.phx.gbl...
Hi Miguel,

I think that the error is that you need a , and a )

<td><img runat="server" src='<%# "..image/" & IIF(dataSetPerson.FieldValue("Author", Container) = "Yes", "icon-yes.gif" , "icon-no.gif") %>'></td>

Why do you not write nice ASPX instead of a kind of coding ASP style in ASPNET, you have got some samples from me, using that it is easier to see where are the errrors?

Cor
Nov 18 '05 #7

P: n/a
Ah what a stupid mistake...i didn't find it so i thought i was doing some
very wrong. It was such a simple thing.

Thank You,
Miguel

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2j*************@uni-berlin.de...
* "Miguel Dias Moura" <we****@27NOSPAMlamps.com> scripsit:
<td><img runat="server" src='<%# "..image/" & IIF(dataSetPerson.FieldValue("Author", Container) = "Yes", "icon-yes.gif"

There is a ', ' missing here.
"icon-no.gif"


... and a ')' here.
%>'></td>

I get this error

Compiler Error Message: BC30455: Argument not specified for parameter

'FalsePart' of 'Public Function IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) As Object'.


--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 18 '05 #8

P: n/a
Hi Miguel,

I corrected the sentence in your code and you did not even see it. That is because in ASP the code is mixed up between the HTML. One of the benefits of ASPX is that that is not needed anymore.

I have sended the sample with the panels to you, when I take only a little part from it by instance a form with only a button on a form and a textbox which when ther is typed something shows the msdn page from microsoft you get this. I find this better to read.

Cor

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<script language="VB" runat="server">
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
If TextBox1.Text = "" Then
Label1.Text = "You should type something"
Else
Response.Redirect("http:\\Msdn.microsoft.com")
End If
End Sub
</script>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<asp:Button id="Button1" onclick="Button1_Click"
runat="server" Text="Button"></asp:Button><br>
<asp:TextBox id="TextBox1" runat="server"></asp:TextBox><br>
<asp:Label id="Label1" runat="server" Width="144px"></asp:Label>
</form>
</body>
</HTML>
///

Nov 18 '05 #9

P: n/a
"Miguel Dias Moura" <we****@27NOSPAMlamps.com> wrote in message news:O7**************@TK2MSFTNGP09.phx.gbl...
Hello,
Then i tryied to change the line to:
<td><img runat="server" src='<%# "..image/" & IIF(dataSetPerson.FieldValue("Author", Container) = "Yes", "icon-yes.gif", "icon-no.gif" %>'></td>

I keep having the same error.

Can somebody help me? I am using ASP.NET / VB.
You still haven't closed the parentheses for the IIF()

Try <%# "..image/" & IIF(dataSetPerson.FieldValue("Author", Container) = "Yes", "icon-yes.gif", "icon-no.gif" ) %>

Brian Lowe
---------@
Nov 18 '05 #10

P: n/a
Hi,

i know what you mean but until now i have been working mostly in Actionscript and Flash.

I am not used to ASP so much. I started to use ASP.NET but sometimes in foruns i get answers that do exactly that: a misture between ASP and ASP.NET and i don't even notice.

The example you sent me is exactly what i use to place a button in my pages and redirect it somewhere...see? I am getting there :-)

By the way, can you sugest me really good books where i can learn ASP.NET?

If possible tell me some titles, from the simple stuff to the really hard stuff.
When i have a book in front of me i am a fast learner. I am used to it.

Thanks,
Miguel

"Cor Ligthert" <no**********@planet.nl> wrote in message news:#9**************@TK2MSFTNGP10.phx.gbl...
Hi Miguel,

I corrected the sentence in your code and you did not even see it. That is because in ASP the code is mixed up between the HTML. One of the benefits of ASPX is that that is not needed anymore.

I have sended the sample with the panels to you, when I take only a little part from it by instance a form with only a button on a form and a textbox which when ther is typed something shows the msdn page from microsoft you get this. I find this better to read.

Cor

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<script language="VB" runat="server">
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
If TextBox1.Text = "" Then
Label1.Text = "You should type something"
Else
Response.Redirect("http:\\Msdn.microsoft.com")
End If
End Sub
</script>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<asp:Button id="Button1" onclick="Button1_Click"
runat="server" Text="Button"></asp:Button><br>
<asp:TextBox id="TextBox1" runat="server"></asp:TextBox><br>
<asp:Label id="Label1" runat="server" Width="144px"></asp:Label>
</form>
</body>
</HTML>
///
Nov 18 '05 #11

P: n/a
Ah about that last part you sent me of the panels...it didn't work out. Have no idea why. I tried to find what was wrong but no success.

Then i created a different code based a little bit on the ideas you gave me. It's working but i think it could be better.

What do you think?

<script language="VB" runat="server">

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)

If Not IsPostBack Then
panelDados1.visible = True
End If

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs)

panelDados1.Visible = True
panelDados2.Visible = False
panelDados3.Visible = False
panelDados4.Visible = False
panelDados5.Visible = False

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs)

panelDados1.Visible = False
panelDados2.Visible = True
panelDados3.Visible = False
panelDados4.Visible = False
panelDados5.Visible = False

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs)

panelDados1.Visible = False
panelDados2.Visible = False
panelDados3.Visible = True
panelDados4.Visible = False
panelDados5.Visible = False

End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs)

panelDados1.Visible = False
panelDados2.Visible = False
panelDados3.Visible = False
panelDados4.Visible = True
panelDados5.Visible = False

End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs)

panelDados1.Visible = False
panelDados2.Visible = False
panelDados3.Visible = False
panelDados4.Visible = False
panelDados5.Visible = True

End Sub

</script>

Thanks,
Miguel

"Cor Ligthert" <no**********@planet.nl> wrote in message news:#9**************@TK2MSFTNGP10.phx.gbl...
Hi Miguel,

I corrected the sentence in your code and you did not even see it. That is because in ASP the code is mixed up between the HTML. One of the benefits of ASPX is that that is not needed anymore.

I have sended the sample with the panels to you, when I take only a little part from it by instance a form with only a button on a form and a textbox which when ther is typed something shows the msdn page from microsoft you get this. I find this better to read.

Cor

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<script language="VB" runat="server">
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
If TextBox1.Text = "" Then
Label1.Text = "You should type something"
Else
Response.Redirect("http:\\Msdn.microsoft.com")
End If
End Sub
</script>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<asp:Button id="Button1" onclick="Button1_Click"
runat="server" Text="Button"></asp:Button><br>
<asp:TextBox id="TextBox1" runat="server"></asp:TextBox><br>
<asp:Label id="Label1" runat="server" Width="144px"></asp:Label>
</form>
</body>
</HTML>
///
Nov 18 '05 #12

P: n/a
I have given the sollution to your problem in the original thread, answer it there because now I get the idea you did not see it.

You do not need that much code as you are using now.

Although I have used a for beginners often difficult routine to set all the panels to invisible (I think that there is the problem when you look at the code) and than in the button click every time set the last visible to invisible and the next to visible.

And maybe did you not see that routine to make the panels invisible.

Answer it in that thread please than it is better to explain.
Cor

Nov 18 '05 #13

P: n/a
How much Dew (trademark) has gone into this already? I am only just installing Visual Basic Studio.NET on the HP, and I can not wait to start creating. Good luck, Miguel. I would give a kernel to have an instant answer for you.

Rev. Chuck ;)
"Miguel Dias Moura" <we****@27NOSPAMlamps.com> wrote in message news:O7**************@TK2MSFTNGP09.phx.gbl...
Hello,
Then i tryied to change the line to:
<td><img runat="server" src='<%# "..image/" & IIF(dataSetPerson.FieldValue("Author", Container) = "Yes", "icon-yes.gif", "icon-no.gif" %>'></td>

I keep having the same error.

Can somebody help me? I am using ASP.NET / VB.


Nov 18 '05 #14

This discussion thread is closed

Replies have been disabled for this discussion.