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. Handling JS file in Resources

Handling JS file in Resources

Scheduled Pinned Locked Moved ASP.NET
javascripthelptutoriallearning
5 Posts 2 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.
  • M Offline
    M Offline
    M J Jaya Chitra
    wrote on last edited by
    #1

    I am having a global resource file in the App_GlobalResources folder. In that I have included my JS file. Also it is in the web applicaiton also. In the run time I want to load the js based on the resource file selected in the page and to register the events for the buttone. Kindly help me how to do it. Thanks a lot in advance.

    Best Regards, M. J. Jaya Chitra

    P 1 Reply Last reply
    0
    • M M J Jaya Chitra

      I am having a global resource file in the App_GlobalResources folder. In that I have included my JS file. Also it is in the web applicaiton also. In the run time I want to load the js based on the resource file selected in the page and to register the events for the buttone. Kindly help me how to do it. Thanks a lot in advance.

      Best Regards, M. J. Jaya Chitra

      P Offline
      P Offline
      PSK_
      wrote on last edited by
      #2

      When you add resource in the resource file in a web application it doesn’t get marked with the WebResource attribute, it means that you can not access this on the basis of the ui culture using a resource manager. This is more appropriate for control development. I suggest you to manually load the js file on the basis of the ui culture. Instead of embedding the js file in global resource, place them in a separate folder and load them accordingly.

      Regards, Prakash Kalakoti

      M 1 Reply Last reply
      0
      • P PSK_

        When you add resource in the resource file in a web application it doesn’t get marked with the WebResource attribute, it means that you can not access this on the basis of the ui culture using a resource manager. This is more appropriate for control development. I suggest you to manually load the js file on the basis of the ui culture. Instead of embedding the js file in global resource, place them in a separate folder and load them accordingly.

        Regards, Prakash Kalakoti

        M Offline
        M Offline
        M J Jaya Chitra
        wrote on last edited by
        #3

        Dear Prakash, Thank your for your hint. Can you tell me how to load the JS dynamically by having them in the web application.

        Best Regards, M. J. Jaya Chitra

        P 1 Reply Last reply
        0
        • M M J Jaya Chitra

          Dear Prakash, Thank your for your hint. Can you tell me how to load the JS dynamically by having them in the web application.

          Best Regards, M. J. Jaya Chitra

          P Offline
          P Offline
          PSK_
          wrote on last edited by
          #4

          Check the Thread.CurrentThread.CurrentCulture.Name and register the script using CleintScript.RegisterClientScriptInclude method like

          ClientScript.RegisterClientScriptInclude("MyScript","MyScript.en-GB.js")

          Regards, Prakash Kalakoti

          M 1 Reply Last reply
          0
          • P PSK_

            Check the Thread.CurrentThread.CurrentCulture.Name and register the script using CleintScript.RegisterClientScriptInclude method like

            ClientScript.RegisterClientScriptInclude("MyScript","MyScript.en-GB.js")

            Regards, Prakash Kalakoti

            M Offline
            M Offline
            M J Jaya Chitra
            wrote on last edited by
            #5

            Thank you so much it is working fine.

            Best Regards, M. J. Jaya Chitra

            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