locked
Startup Javascript RRS feed

  • Question

  • User-1690009347 posted
    I have some javascript which sets some values in hidden inputs. The problem is that the javascript seems to run only after the page has loaded. This means that I can't get these values back from serverside. The only way I can do it is to get the javascript to force a postback but I don't like this as each page which has the control on it will have to postback on every load. Is there a way to get the javascript to run before the page has loaded so that my control can read the values in the hidden inputs?
    Monday, April 28, 2008 6:42 AM

Answers

  • User-1924877455 posted
    As the other poster has said, its a client technology and will not allow this operation. It would be better if you think of alternative design and if you could tell here what you are trying to achieve, folks here can help you with that. -- Madhur "coolblue" wrote in message news:2324645@forums.asp.net... >I have some javascript which sets some values in hidden inputs. The problem >is that the javascript seems to run only after the page has loaded. This >means that I can't get these values back from serverside. The only way I >can do it is to get the javascript to force a postback but I don't like >this as each page which has the control on it will have to postback on >every load. Is there a way to get the javascript to run before the page has >loaded so that my control can read the values in the hidden inputs? >
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 28, 2008 10:18 AM

All replies

  • User68971474 posted

    Since Javascript is client technology, it will only run in the client browser.  In other words Javascript will ALWAYS run after the page has loaded.

    Monday, April 28, 2008 7:00 AM
  • User-1924877455 posted
    As the other poster has said, its a client technology and will not allow this operation. It would be better if you think of alternative design and if you could tell here what you are trying to achieve, folks here can help you with that. -- Madhur "coolblue" wrote in message news:2324645@forums.asp.net... >I have some javascript which sets some values in hidden inputs. The problem >is that the javascript seems to run only after the page has loaded. This >means that I can't get these values back from serverside. The only way I >can do it is to get the javascript to force a postback but I don't like >this as each page which has the control on it will have to postback on >every load. Is there a way to get the javascript to run before the page has >loaded so that my control can read the values in the hidden inputs? >
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 28, 2008 10:18 AM