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 can be used in ASP.net ?

JavaScript can be used in ASP.net ?

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptasp-netsharepointtutorial
8 Posts 4 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.
  • S Offline
    S Offline
    Sachin Pimpale
    wrote on last edited by
    #1

    i want to know can we impliment javascript code in ASP.net as we use in ASP if yes then please suggest me how to inmplment it. TX.:)

    SP -- Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.

    S S 2 Replies Last reply
    0
    • S Sachin Pimpale

      i want to know can we impliment javascript code in ASP.net as we use in ASP if yes then please suggest me how to inmplment it. TX.:)

      SP -- Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.

      S Offline
      S Offline
      Sams Den
      wrote on last edited by
      #2

      Hi, Yes you can surely do that. You need to add a client side script block in .aspx page and then you can write a javascript code block (functions..etc) there. Hope this helps. Thanks. Sameer

      S 1 Reply Last reply
      0
      • S Sams Den

        Hi, Yes you can surely do that. You need to add a client side script block in .aspx page and then you can write a javascript code block (functions..etc) there. Hope this helps. Thanks. Sameer

        S Offline
        S Offline
        Sachin Pimpale
        wrote on last edited by
        #3

        please specify if there is any example code of that ;)

        SP -- Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.

        S 1 Reply Last reply
        0
        • S Sachin Pimpale

          please specify if there is any example code of that ;)

          SP -- Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.

          S Offline
          S Offline
          Sams Den
          wrote on last edited by
          #4

          Hi, Have a look: /*

          <!-- function PopMe() { alert ('Test'); } //--> */

          S 1 Reply Last reply
          0
          • S Sams Den

            Hi, Have a look: /*

            <!-- function PopMe() { alert ('Test'); } //--> */

            S Offline
            S Offline
            Sachin Pimpale
            wrote on last edited by
            #5

            thank for sample code happy coading ;)

            SP -- Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.

            P 1 Reply Last reply
            0
            • S Sachin Pimpale

              thank for sample code happy coading ;)

              SP -- Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              You can also inject javascript from your server side code. For example:

              private void Closer_Click(object sender, EventArgs e)
              {
                Page.RegisterStartupScript("closerScript", 
                "<script language='JavaScript'>window.close();</script>"
              }
              

              This code will close the current window when the Closer button is clicked.

              the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
              Deja View - the feeling that you've seen this post before.

              S 1 Reply Last reply
              0
              • P Pete OHanlon

                You can also inject javascript from your server side code. For example:

                private void Closer_Click(object sender, EventArgs e)
                {
                  Page.RegisterStartupScript("closerScript", 
                  "<script language='JavaScript'>window.close();</script>"
                }
                

                This code will close the current window when the Closer button is clicked.

                the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
                Deja View - the feeling that you've seen this post before.

                S Offline
                S Offline
                Sachin Pimpale
                wrote on last edited by
                #7

                thanks for responce

                SP -- Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.

                1 Reply Last reply
                0
                • S Sachin Pimpale

                  i want to know can we impliment javascript code in ASP.net as we use in ASP if yes then please suggest me how to inmplment it. TX.:)

                  SP -- Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.

                  S Offline
                  S Offline
                  stephenSmithJ
                  wrote on last edited by
                  #8

                  You can also add script to the Attributes of a server control. For instance, cboSurveyType is a drop down billingMethod is the js I want to invoke via the onChange event... Important: place in a "if (!this.IsPostBack)" block PS: toBad you can't add it via prop page... very shortsighted of ms... protected void Page_Load(object sender, EventArgs e) { try { if (!this.IsPostBack) { cboSurveyType.Attributes.Add("onChange", "billingMethod();"); } } finally { } }

                  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