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. General Programming
  3. C#
  4. Javascript with Visual Studio 2013

Javascript with Visual Studio 2013

Scheduled Pinned Locked Moved C#
helpcsharpjavascriptasp-netvisual-studio
3 Posts 3 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.
  • D Offline
    D Offline
    Dolly Nimavat
    wrote on last edited by
    #1

    Can I use javascript in web forms project which has master pages and content pages. I know it can be used but the code written in script tag or style tag is not executed. I have tried too many solutions I get from sites like stakoverflow and codeproject because I am facing this problem since 15-20 days, even there is no error in the syntax. But the problem is script is not executed.

    P F 2 Replies Last reply
    0
    • D Dolly Nimavat

      Can I use javascript in web forms project which has master pages and content pages. I know it can be used but the code written in script tag or style tag is not executed. I have tried too many solutions I get from sites like stakoverflow and codeproject because I am facing this problem since 15-20 days, even there is no error in the syntax. But the problem is script is not executed.

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

      A couple of things. 1. This is the C# forum, so you're not going to have much luck here. 2. You haven't shown any code. No one will be able to help you identify a problem with your code if you haven't shown it.

      1 Reply Last reply
      0
      • D Dolly Nimavat

        Can I use javascript in web forms project which has master pages and content pages. I know it can be used but the code written in script tag or style tag is not executed. I have tried too many solutions I get from sites like stakoverflow and codeproject because I am facing this problem since 15-20 days, even there is no error in the syntax. But the problem is script is not executed.

        F Offline
        F Offline
        F ES Sitecore
        wrote on last edited by
        #3

        Your problem is that you're not appreciating that javascript runs on the client using the rendered html, and what you see in visual studio aspx files is not what is rendered to the client. .net will change your control IDs so if you refer to IDs in your js you need to use the ClientID property of the control to get the proper ID, or use static ids if that is suitable (it won't always be); ASP.NET 4.0 Client ID Feature[^] Other things you need to bear in mind are code paths and how you refer to your js files in relation to your other files. There is no single trick to this, it mainly involves having a good understanding of the framework and using best practises in your coding, and tackling individual problems as you encounter them.

        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