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. how I can use jscript file in asp 2.0

how I can use jscript file in asp 2.0

Scheduled Pinned Locked Moved ASP.NET
javahtmltoolshelp
4 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.
  • A Offline
    A Offline
    ahmed_fci2006
    wrote on last edited by
    #1

    I want to use java script function in asp page"aspx" I have the code in html page but i want to run it in aspx page and i don't know about jscript file i didn't use it before can any body help me thx.:sigh:

    let's work together

    K A S 3 Replies Last reply
    0
    • A ahmed_fci2006

      I want to use java script function in asp page"aspx" I have the code in html page but i want to run it in aspx page and i don't know about jscript file i didn't use it before can any body help me thx.:sigh:

      let's work together

      K Offline
      K Offline
      Krugger404
      wrote on last edited by
      #2

      Hi Ahmed, aspx has really something to do with html. If you take a closer look at an aspx file, you will see the regular etc... tag. So, to include a javascript file and use functions therein, follow the example below: (1) Say we have a file called scripts.js containing a function "test()" that we want to use. (2) Place the tag "script language="javascript" src="scripts.js">" tag between the "" and "" tag (3) Next say i have a texbox and i want to execute function "test()" on leaving the textbox Code :

      1 Reply Last reply
      0
      • A ahmed_fci2006

        I want to use java script function in asp page"aspx" I have the code in html page but i want to run it in aspx page and i don't know about jscript file i didn't use it before can any body help me thx.:sigh:

        let's work together

        A Offline
        A Offline
        Abolfazl Sheikhloo
        wrote on last edited by
        #3

        i don't understand your question carefully. but u can use from this code:

        We Can Do Anything, If We Want It

        1 Reply Last reply
        0
        • A ahmed_fci2006

          I want to use java script function in asp page"aspx" I have the code in html page but i want to run it in aspx page and i don't know about jscript file i didn't use it before can any body help me thx.:sigh:

          let's work together

          S Offline
          S Offline
          saini arun
          wrote on last edited by
          #4

          if you want your code to run at the time of page load... use the following code... Page.RegisterStartupScript("MyDemo", "alert('hi there');"); /*use the function name on the place of alert()*/ and if you want ur JS code to fire on the occurance of a button onClick.... Button1.Attributes.Add("onclick", "sampleJSfunction()");

          “The woods are lovely, dark and deep. But I have promises to keep, and miles to go before I sleep.”

          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