473,465 Members | 4,823 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 20 '05 #1
13 1758
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 20 '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 20 '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 20 '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 20 '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 20 '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 20 '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 20 '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 20 '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 20 '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 20 '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 20 '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 20 '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 20 '05 #14

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

Similar topics

4
by: Simom Thorpe | last post by:
Hi, I'm trying to insert a line into a MS access DB using ASP on IIS 5. This is the line: con.execute "INSERT INTO newProds(title,desc,catcode) VALUES ('Champagne Muff Scarf','','AC304B')"...
47
by: Neal | last post by:
Patrick Griffiths weighs in on the CSS vs table layout debate in his blog entry "Tables my ass" - http://www.htmldog.com/ptg/archives/000049.php . A quite good article.
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...
22
by: noridotjabi | last post by:
Okay. I'm quite embarased to be asking this but I cannot seem to get files to work. I don't know what the problem is. Is there something wrong with this: (file related) #include <stdio.h>...
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 {
2
by: Rod | last post by:
I've been struggling with this thing for 2 days, and after searching the 'net for help, I cannot find what is wrong. We're using Crystal Reports XI Release 2, with Visual Studio .NET 2003 in...
10
by: Enkidu | last post by:
Beginner question, sorry! I am using indexers to access an array of StringBuilders in an instance of a class: Getting: value = board1; Setting: board1 = value1 ;
6
by: Kid Programmer | last post by:
Hello guys. I have a question. What's wrong with my compiler. In a simple number averaging program in a GUI window have way into the project I compile the program and I get the following errors: ...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.