Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. JavaScript
  4. How to add a Second Parameter

How to add a Second Parameter

Scheduled Pinned Locked Moved JavaScript
csharpjavascriptasp-netcom
8 Posts 3 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vimalsoft Pty Ltd
    wrote on last edited by
    #1

    How to add a Second Parameter

    <%# Eval("Patameter1","return showComment(""{0}"")") %>

    please note that the "showComment" is a Jquery function Thanks

    Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@dotnetfunda.com http://www.Dotnetfunda.com

    M 1 Reply Last reply
    0
    • V Vimalsoft Pty Ltd

      How to add a Second Parameter

      <%# Eval("Patameter1","return showComment(""{0}"")") %>

      please note that the "showComment" is a Jquery function Thanks

      Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@dotnetfunda.com http://www.Dotnetfunda.com

      M Offline
      M Offline
      Matt Meyer
      wrote on last edited by
      #2

      You can using String.Format directly in the binding:

      <%# String.Format("return showComment(""{0}"",""{1}"")", "Patameter1", "Parameter2") %>

      V 1 Reply Last reply
      0
      • M Matt Meyer

        You can using String.Format directly in the binding:

        <%# String.Format("return showComment(""{0}"",""{1}"")", "Patameter1", "Parameter2") %>

        V Offline
        V Offline
        Vimalsoft Pty Ltd
        wrote on last edited by
        #3

        hi Mat here is my code with your advice

        <asp:ImageButton ID="btnComment" runat="server"
        ImageUrl="~/Imgs/comment2.png"
        OnClientClick= '<%# String.Format("return showComment(""{0}"",""{1}"")", "Parameter1", ""Parameter2") %>'
        ToolTip="Click here to view a Comment" Visible='<%# CheckPendStatus() %>' />

        and it gives an Error

        Error 149 Comma, ')', or a valid expression continuation expected.
        Error 219 Comma, ')', or a valid expression continuation expected.

        Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@dotnetfunda.com http://www.Dotnetfunda.com

        M 1 Reply Last reply
        0
        • V Vimalsoft Pty Ltd

          hi Mat here is my code with your advice

          <asp:ImageButton ID="btnComment" runat="server"
          ImageUrl="~/Imgs/comment2.png"
          OnClientClick= '<%# String.Format("return showComment(""{0}"",""{1}"")", "Parameter1", ""Parameter2") %>'
          ToolTip="Click here to view a Comment" Visible='<%# CheckPendStatus() %>' />

          and it gives an Error

          Error 149 Comma, ')', or a valid expression continuation expected.
          Error 219 Comma, ')', or a valid expression continuation expected.

          Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@dotnetfunda.com http://www.Dotnetfunda.com

          M Offline
          M Offline
          Matt Meyer
          wrote on last edited by
          #4

          You have a second quote before Parameter2.

          V A 2 Replies Last reply
          0
          • M Matt Meyer

            You have a second quote before Parameter2.

            V Offline
            V Offline
            Vimalsoft Pty Ltd
            wrote on last edited by
            #5

            hi Matt thanks for pointing that out it now looks like this

            '<%# String.Format("return showComment(""{0}"",""{1}"")", "PARAMETER1", "PARAMETER2") %>'

            when i run it it does not take the values but it give me the names of the variable, can i use Eval like this

            '<%# String.Format("return showComment(""{0}"",""{1}"")", Eval("PARAMETER1"), Eval("PARAMETER2") %>'

            THanks

            Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@dotnetfunda.com http://www.Dotnetfunda.com

            M 1 Reply Last reply
            0
            • V Vimalsoft Pty Ltd

              hi Matt thanks for pointing that out it now looks like this

              '<%# String.Format("return showComment(""{0}"",""{1}"")", "PARAMETER1", "PARAMETER2") %>'

              when i run it it does not take the values but it give me the names of the variable, can i use Eval like this

              '<%# String.Format("return showComment(""{0}"",""{1}"")", Eval("PARAMETER1"), Eval("PARAMETER2") %>'

              THanks

              Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@dotnetfunda.com http://www.Dotnetfunda.com

              M Offline
              M Offline
              Matt Meyer
              wrote on last edited by
              #6

              I used string literals in my example. If you want the variables themselves (and they're at least protected), you can do this:

              <%# String.Format("return showComment(""{0}"",""{1}"")", Parameter1, Parameter2) %>

              where Parameter1 and Parameter2 are variable names in the page object.

              V 1 Reply Last reply
              0
              • M Matt Meyer

                I used string literals in my example. If you want the variables themselves (and they're at least protected), you can do this:

                <%# String.Format("return showComment(""{0}"",""{1}"")", Parameter1, Parameter2) %>

                where Parameter1 and Parameter2 are variable names in the page object.

                V Offline
                V Offline
                Vimalsoft Pty Ltd
                wrote on last edited by
                #7

                Thank you very much for you help , i have ended up using it this way and it works

                '<%# String.Format("return showComment(""{0}"",""{1}"")", Eval("Parameter1"), Eval("Parameter2")) %>'

                Thanks you a Star

                Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@dotnetfunda.com http://www.Dotnetfunda.com

                1 Reply Last reply
                0
                • M Matt Meyer

                  You have a second quote before Parameter2.

                  A Offline
                  A Offline
                  Anuradha Lakra
                  wrote on last edited by
                  #8

                  Thanks. Your code solved my problem

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups