How can I get hold a session from date picker?
For all my textbox, I hold it using :
Session["location"] = DropDownList1.SelectedItem.Text;
Session["time"] = DropDownList2.SelectedItem.Text;
Session["day"] = DropDownList3.SelectedItem.Text;
Session["IsChauffeurUsed"] = DropDownList4.SelectedItem.Text;
But for my text box date picker, when I write the code
Session["date"] = datepicker.Text;
It gives me an error, the current context does not exist.
The date picker text box is :
<div class="demo"><p>Date: <input type="text" id="datepicker"></p></div>
Hope you can help.
Thanks.
Set
runat=serverattribute to convert html tag to Html server control.and use
valueattribute because it is now ASP.NET Web Server control.Edit: This works perfectly on my side.