This is a migrated thread and some comments may be shown as answers.

[Solved] Save value to session

2 Answers 122 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jonisan
Top achievements
Rank 1
Jonisan asked on 11 Feb 2012, 08:42 PM
I need the value from a DatePicker and a DropDownList to be saved to session . 
For this I added to them a  ".ClientEvents(events => events.OnChange("onChangeDatePicker")"
and so I have the changed value of the datePicker and Dropdown in those javascript functions .
I don't think this is the way to do it , because I was unable to save those values to session from that point.

If this is the solution plzz help me with what I miss , but I dont think it is .. I think the solution is to
map a session variable to DatePicker and DropDownList current value , but I don't know how. 


Thank you

2 Answers, 1 is accepted

Sort by
0
Jonisan
Top achievements
Rank 1
answered on 13 Feb 2012, 11:04 AM
I got a solution to send to server the value to be added in the session : 
function onChangeDatePicker(e) {
        $.post('<%= Url.Action("DateChanged","Home") %>',
            { dateTime: e.value.toString() },
            function (result) {
                // .
            });        
    }
If there is a better way to do it plzz sam1 say that .. 
0
Jonisan
Top achievements
Rank 1
answered on 13 Feb 2012, 11:31 PM
Ok .. It is me again .. sorry ,my head is not helping me that much , but how do you initialize the datePicker from the server ?
Tags
Date/Time Pickers
Asked by
Jonisan
Top achievements
Rank 1
Answers by
Jonisan
Top achievements
Rank 1
Share this question
or