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. ASP.NET
  4. Javascript-codebehind

Javascript-codebehind

Scheduled Pinned Locked Moved ASP.NET
6 Posts 5 Posters 0 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.
  • N Offline
    N Offline
    niki_nilu
    wrote on last edited by
    #1

    hi how to write javascript function in html part and how to call it in codebehind in asp.net using c# pls reply me. thanku gayatri Gayatri

    C N R S 4 Replies Last reply
    0
    • N niki_nilu

      hi how to write javascript function in html part and how to call it in codebehind in asp.net using c# pls reply me. thanku gayatri Gayatri

      C Offline
      C Offline
      ca8msm
      wrote on last edited by
      #2

      Why would you need to call a javascript function from a code-behind page?

      Mark, http://aspnetlibrary.com

      1 Reply Last reply
      0
      • N niki_nilu

        hi how to write javascript function in html part and how to call it in codebehind in asp.net using c# pls reply me. thanku gayatri Gayatri

        N Offline
        N Offline
        N a v a n e e t h
        wrote on last edited by
        #3

        wrote:

        how to write javascript function in html part

        Start <script> tag and write your functions like this

        <script language="javascript">
        function Sample()
        {
        alert("Hi Javascript");
        }
        </script>

        Put the above code on your head section.

        wrote:

        and how to call it in codebehind in asp.net using c#

        Each control will be having one property called attributes. Use

        ControlName.Attributes.Add("OnClick","Sample();");


        string Cheers = "Navaneeth!!" www.w3hearts.com

        1 Reply Last reply
        0
        • N niki_nilu

          hi how to write javascript function in html part and how to call it in codebehind in asp.net using c# pls reply me. thanku gayatri Gayatri

          R Offline
          R Offline
          RichardGrimmer
          wrote on last edited by
          #4

          Standard explanation #1 (Client vs Server) needed!

          "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox

          S 1 Reply Last reply
          0
          • N niki_nilu

            hi how to write javascript function in html part and how to call it in codebehind in asp.net using c# pls reply me. thanku gayatri Gayatri

            S Offline
            S Offline
            Sandeep Akhare
            wrote on last edited by
            #5

            Javascript is scripting language run at client side it run first before going to server

            Thanks and Regards Sandeep If you want something you never had, do something you have never done!

            1 Reply Last reply
            0
            • R RichardGrimmer

              Standard explanation #1 (Client vs Server) needed!

              "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox

              S Offline
              S Offline
              Sandeep Akhare
              wrote on last edited by
              #6

              RichardGrimmer wrote:

              Standard explanation #1 (Client vs Server) needed!

              Sorry but not understoo:rolleyes:d

              Thanks and Regards Sandeep If you want something you never had, do something you have never done!

              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