Calendar input value overwritten on postback

K

Kelly

I am using javascript to dynamically create a date picker input control on a
..Net webform. On postback, the selected value gets overwritten by the default
value generated by the javascript. What can I do?
 
G

Guest

I am using javascript to dynamically create a date picker input control on a
.Net webform. On postback, the selected value gets overwritten by the default
value generated by the javascript. What can I do?

Hi Kelly

it will depend on how it is implemented. I think you can try to use a
hidden variable which would change its value after postback. The value
must be checked in the javascript after that. You can also inject the
javascript code on a postback, for example

<script>
var default_value=<%=cal_value%>
</script>

in the code-behind

if (Page.IsPostBack)
cal_value = ...
else
cal_value = ...

Hope this helps
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top