Setting hidden fields from event handlers for control.

Discussion in 'ASP .Net' started by Harshal P, Mar 28, 2006.

  1. Harshal P

    Harshal P Guest

    I am settings hidden field value from the DayRender event hadler of the calendar control, when i try to read the value of hidden field from
    javascript, the value is empty string. If i do the same (setting hidden
    field value) from Page_Load(), then the same is reflected in the javascript.
    I am using 2.0 with XP SP2 machine.

    Thanks in advance.
    Harshal P, Mar 28, 2006
    1. Advertisements

  2. Harshal P

    Guest Guest

    Imagine saying this: I opened my refrigerator at home and there was a bottle
    of milk, but when I got to work and opened the refrigerator, there was no
    bottle of milk. Unless you carried the milk to work, it is not there.

    The same is true for server and client side in browser applications. Unless
    you send the information to the client, it is not there (actually it is, in
    ViewState, but there is no mechanism to pull from ViewState on the client).
    If you want to manipulated, set down a bit of JavaScript, with the value you
    desire, and the client will see it. Remember you have to set it in a form
    field to get it back to the server if it is changed.

    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    Think Outside the Box!
    Guest, Mar 28, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.