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 to Call javascript function before running server side code.?

How to Call javascript function before running server side code.?

Scheduled Pinned Locked Moved ASP.NET
helpjavascriptsysadmintutorialquestion
3 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.
  • R Offline
    R Offline
    rahul net11
    wrote on last edited by
    #1

    Hi all, I have write a JavaScript function and calling the function on body load event, in that function i am assigning a value to hidden field control. On Page behind i am need to use the hidden filed value in a function so i am accessing the field value but each and every time i am getting the value as "" (blank) because first the server side code execute and after that the JavaScript code execute. I want to run the JavaScript function before running server side code so that i can get the hidden field value. Please help me to solve the problem? Thanks

    People Laugh on me Because i am Different but i Laugh on them Because they all are same.

    B 1 Reply Last reply
    0
    • R rahul net11

      Hi all, I have write a JavaScript function and calling the function on body load event, in that function i am assigning a value to hidden field control. On Page behind i am need to use the hidden filed value in a function so i am accessing the field value but each and every time i am getting the value as "" (blank) because first the server side code execute and after that the JavaScript code execute. I want to run the JavaScript function before running server side code so that i can get the hidden field value. Please help me to solve the problem? Thanks

      People Laugh on me Because i am Different but i Laugh on them Because they all are same.

      B Offline
      B Offline
      Brij
      wrote on last edited by
      #2

      Why are you assigning the value on body on load event?

      Cheers!! Brij Check My Latest Article

      R 1 Reply Last reply
      0
      • B Brij

        Why are you assigning the value on body on load event?

        Cheers!! Brij Check My Latest Article

        R Offline
        R Offline
        rahul net11
        wrote on last edited by
        #3

        Because, On load event i am passing this value to a function and by using the value i am retrieving data from my db. Thanks

        People Laugh on me Because i am Different but i Laugh on them Because they all are same.

        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