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. Reading from global resource file in javascript function

Reading from global resource file in javascript function

Scheduled Pinned Locked Moved ASP.NET
javascriptquestionlearning
6 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
    deep7
    wrote on last edited by
    #1

    Hi, can anyone please tell me how i can read from a global resource file in my javascript function? I need to show the message which will be there in a resource file on alert message. Can anyone tell me ?

    N N 2 Replies Last reply
    0
    • D deep7

      Hi, can anyone please tell me how i can read from a global resource file in my javascript function? I need to show the message which will be there in a resource file on alert message. Can anyone tell me ?

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

      deep7 wrote:

      how i can read from a global resource file in my javascript function?

      I think you can't do this. You can take this value at the server side and put that to hidden textbox. Then you can show this message with javascript alert


      Sincerly Navaneeth My Website

      D N 3 Replies Last reply
      0
      • N N a v a n e e t h

        deep7 wrote:

        how i can read from a global resource file in my javascript function?

        I think you can't do this. You can take this value at the server side and put that to hidden textbox. Then you can show this message with javascript alert


        Sincerly Navaneeth My Website

        D Offline
        D Offline
        deep7
        wrote on last edited by
        #3

        yes even i think that...thanks a lot :) Regards, Dee

        1 Reply Last reply
        0
        • N N a v a n e e t h

          deep7 wrote:

          how i can read from a global resource file in my javascript function?

          I think you can't do this. You can take this value at the server side and put that to hidden textbox. Then you can show this message with javascript alert


          Sincerly Navaneeth My Website

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          There is no need for a hidden field. The text can be placed in a javascript variable during page load or init.


          only two letters away from being an asset

          1 Reply Last reply
          0
          • D deep7

            Hi, can anyone please tell me how i can read from a global resource file in my javascript function? I need to show the message which will be there in a resource file on alert message. Can anyone tell me ?

            N Offline
            N Offline
            Not Active
            wrote on last edited by
            #5

            Although placing the text in a javascript variable during page load would work, you can also make an AJAX call to retrieve the message from a resource file.


            only two letters away from being an asset

            1 Reply Last reply
            0
            • N N a v a n e e t h

              deep7 wrote:

              how i can read from a global resource file in my javascript function?

              I think you can't do this. You can take this value at the server side and put that to hidden textbox. Then you can show this message with javascript alert


              Sincerly Navaneeth My Website

              D Offline
              D Offline
              deep7
              wrote on last edited by
              #6

              i found out the way to do it...set the string in server side from global resource file. then in javascript alert , use it like this: '<%=strVar%>' so there no need for hidden textboxes.

              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