Setting hidden fields from event handlers for control.

H

Harshal P

Hello,
I am settings hidden field value from the DayRender event hadler of the
asp.net 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 asp.net 2.0 with XP SP2 machine.

Thanks in advance.
 
G

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!
***************************
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top