What is wrong with this line?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Miguel Dias Moura

    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(dataSetPers on.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(dataSetPers on.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




  • NM

    #2
    Re: What is wrong with this line?

    Hi,

    "Miguel Dias Moura" <web001@27NOSPA Mlamps.com> a écrit dans le message de news:O7ED6r5VEH A.1656@TK2MSFTN GP09.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(dataSetPers on.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(dataSetPers on.FieldValue(" Author", Container) = "Yes", "icon-yes.gif", "icon-no.gif") %>'></td>

    Regards

    Comment

    • Miguel Dias Moura

      #3
      Re: What is wrong with this line?

      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_656@hotmail .com> wrote in message news:usSZ605VEH A.584@TK2MSFTNG P09.phx.gbl...
      Hi,

      "Miguel Dias Moura" <web001@27NOSPA Mlamps.com> a écrit dans le message de news:O7ED6r5VEH A.1656@TK2MSFTN GP09.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(dataSetPers on.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(dataSetPers on.FieldValue(" Author", Container) = "Yes", "icon-yes.gif", "icon-no.gif") %>'></td>

      Regards

      Comment

      • Marina

        #4
        Re: What is wrong with this line?

        You need to close the parenthesis, because you have an opening paren for your IIF, but not a closing one.
        "Miguel Dias Moura" <web001@27NOSPA Mlamps.com> wrote in message news:O7ED6r5VEH A.1656@TK2MSFTN GP09.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(dataSetPers on.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(dataSetPers on.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



        Comment

        • Cor Ligthert

          #5
          Re: What is wrong with this line?

          Hi Miguel,

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

          <td><img runat="server" src='<%# "..image/" & IIF(dataSetPers on.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

          Comment

          • Herfried K. Wagner [MVP]

            #6
            Re: What is wrong with this line?

            * "Miguel Dias Moura" <web001@27NOSPA Mlamps.com> scripsit:[color=blue]
            > <td><img runat="server" src='<%# "..image/" & IIF(dataSetPers on.FieldValue(" Author", Container) = "Yes", "icon-yes.gif"[/color]

            There is a ', ' missing here.
            [color=blue]
            > "icon-no.gif"[/color]

            .... and a ')' here.


            %>'></td>[color=blue]
            >
            > 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'.[/color]

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

            Comment

            • Miguel Dias Moura

              #7
              Re: What is wrong with this line?

              What do you mean? How would you create this?
              I am what would be the best way to do this?

              Thanks,
              Miguel
              "Cor Ligthert" <notfirstname@p lanet.nl> wrote in message news:#YufNf6VEH A.3024@TK2MSFTN GP09.phx.gbl...
              Hi Miguel,

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

              <td><img runat="server" src='<%# "..image/" & IIF(dataSetPers on.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


              Comment

              • Miguel Dias Moura

                #8
                Re: What is wrong with this line?

                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]" <hirf-spam-me-here@gmx.at> wrote in message
                news:2jogbcF13l u7lU1@uni-berlin.de...[color=blue]
                > * "Miguel Dias Moura" <web001@27NOSPA Mlamps.com> scripsit:[color=green]
                > > <td><img runat="server" src='<%# "..image/" &[/color][/color]
                IIF(dataSetPers on.FieldValue(" Author", Container) = "Yes", "icon-yes.gif"[color=blue]
                >
                > There is a ', ' missing here.
                >[color=green]
                > > "icon-no.gif"[/color]
                >
                > ... and a ')' here.
                >
                >
                > %>'></td>[color=green]
                > >
                > > I get this error
                > >
                > > Compiler Error Message: BC30455: Argument not specified for parameter[/color][/color]
                'FalsePart' of 'Public Function IIf(Expression As Boolean,[color=blue][color=green]
                > > TruePart As Object, FalsePart As Object) As Object'.[/color]
                >
                > --
                > Herfried K. Wagner [MVP]
                > <URL:http://dotnet.mvps.org/>[/color]


                Comment

                • Cor Ligthert

                  #9
                  Re: What is wrong with this line?

                  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(B yVal sender As System.Object, _
                  ByVal e As System.EventArg s)
                  If TextBox1.Text = "" Then
                  Label1.Text = "You should type something"
                  Else
                  Response.Redire ct("http:\\Msdn .microsoft.com" )
                  End If
                  End Sub
                  </script>
                  </HEAD>
                  <body>
                  <form id="Form1" method="post" runat="server">
                  <asp:Button id="Button1" onclick="Button 1_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>
                  ///

                  Comment

                  • Brian Lowe

                    #10
                    Re: What is wrong with this line?

                    "Miguel Dias Moura" <web001@27NOSPA Mlamps.com> wrote in message news:O7ED6r5VEH A.1656@TK2MSFTN GP09.phx.gbl...
                    Hello,


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

                    Brian Lowe
                    ---------@

                    Comment

                    • Miguel Dias Moura

                      #11
                      Re: What is wrong with this line?

                      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" <notfirstname@p lanet.nl> wrote in message news:#9awBH8VEH A.1128@TK2MSFTN GP10.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(B yVal sender As System.Object, _
                      ByVal e As System.EventArg s)
                      If TextBox1.Text = "" Then
                      Label1.Text = "You should type something"
                      Else
                      Response.Redire ct("http:\\Msdn .microsoft.com" )
                      End If
                      End Sub
                      </script>
                      </HEAD>
                      <body>
                      <form id="Form1" method="post" runat="server">
                      <asp:Button id="Button1" onclick="Button 1_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>
                      ///


                      Comment

                      • Miguel Dias Moura

                        #12
                        Re: What is wrong with this line?

                        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.EventArg s)

                        If Not IsPostBack Then
                        panelDados1.vis ible = True
                        End If

                        End Sub

                        Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.Web.UI.I mageClickEventA rgs)

                        panelDados1.Vis ible = True
                        panelDados2.Vis ible = False
                        panelDados3.Vis ible = False
                        panelDados4.Vis ible = False
                        panelDados5.Vis ible = False

                        End Sub

                        Private Sub Button2_Click(B yVal sender As System.Object, ByVal e As System.Web.UI.I mageClickEventA rgs)

                        panelDados1.Vis ible = False
                        panelDados2.Vis ible = True
                        panelDados3.Vis ible = False
                        panelDados4.Vis ible = False
                        panelDados5.Vis ible = False

                        End Sub

                        Private Sub Button3_Click(B yVal sender As System.Object, ByVal e As System.Web.UI.I mageClickEventA rgs)

                        panelDados1.Vis ible = False
                        panelDados2.Vis ible = False
                        panelDados3.Vis ible = True
                        panelDados4.Vis ible = False
                        panelDados5.Vis ible = False

                        End Sub

                        Private Sub Button4_Click(B yVal sender As System.Object, ByVal e As System.Web.UI.I mageClickEventA rgs)

                        panelDados1.Vis ible = False
                        panelDados2.Vis ible = False
                        panelDados3.Vis ible = False
                        panelDados4.Vis ible = True
                        panelDados5.Vis ible = False

                        End Sub

                        Private Sub Button5_Click(B yVal sender As System.Object, ByVal e As System.Web.UI.I mageClickEventA rgs)

                        panelDados1.Vis ible = False
                        panelDados2.Vis ible = False
                        panelDados3.Vis ible = False
                        panelDados4.Vis ible = False
                        panelDados5.Vis ible = True

                        End Sub

                        </script>

                        Thanks,
                        Miguel

                        "Cor Ligthert" <notfirstname@p lanet.nl> wrote in message news:#9awBH8VEH A.1128@TK2MSFTN GP10.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(B yVal sender As System.Object, _
                        ByVal e As System.EventArg s)
                        If TextBox1.Text = "" Then
                        Label1.Text = "You should type something"
                        Else
                        Response.Redire ct("http:\\Msdn .microsoft.com" )
                        End If
                        End Sub
                        </script>
                        </HEAD>
                        <body>
                        <form id="Form1" method="post" runat="server">
                        <asp:Button id="Button1" onclick="Button 1_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>
                        ///


                        Comment

                        • Cor Ligthert

                          #13
                          Re: What is wrong with this line?

                          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

                          Comment

                          • The Apollonian King

                            #14
                            Re: What is wrong with this line?

                            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 ;)
                            [color=blue]
                            > "Miguel Dias Moura" <web001@27NOSPA Mlamps.com> wrote in message news:O7ED6r5VEH A.1656@TK2MSFTN GP09.phx.gbl...
                            > Hello,
                            >
                            >
                            > Then i tryied to change the line to:
                            > <td><img runat="server" src='<%# "..image/" & IIF(dataSetPers on.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.
                            >
                            >[/color]

                            Comment

                            Working...