473,396 Members | 1,933 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,396 software developers and data experts.

What is wrong with this line?

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
13 1428
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
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
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
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
* "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
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
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
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
"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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

72
by: E. Robert Tisdale | last post by:
What makes a good C/C++ programmer? Would you be surprised if I told you that it has almost nothing to do with your knowledge of C or C++? There isn't much difference in productivity, for...
51
by: WindAndWaves | last post by:
Can anyone tell me what is wrong with the goto command. I noticed it is one of those NEVER USE. I can understand that it may lead to confusing code, but I often use it like this: is this...
65
by: E. Robert Tisdale | last post by:
What makes a good C/C++ programmer? Would you be surprised if I told you that it has almost nothing to do with your knowledge of C or C++? There isn't much difference in productivity, for...
2
by: Phil | last post by:
Problem code: using System; using System.Collections.Generic; using System.Text; using System.IO; using System.Diagnostics; namespace Streams { class Program {
4
by: hirsh.dan | last post by:
i have a functions that writes information to a file. inside that function i have a line in which i call another function. if this line is executed, nothing is written to the file, but if i remark...
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: 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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.