Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

When I am trying to show date from sql into the textbox linked to datepicker, the textbox shows blank.

I guess the issue may be linked to the default date of datepicker.

If my guess is correct can anyone pls suggest how to set the date in datepicker with VB code.

Thanks in advance

Atul
Posted
Comments
Er. Puneet Goel 10-Sep-14 5:09am    
please post you code. So that we can figure out the issue.

1 solution

Thanks for the reply puneet.

I found the solution self.

I created a session variable with the value from sql and added a jquery function to link textbox to that variable.

XML
<script>
       var TargetDate = '<%=Session("TargetDate")%>';
       $(function () {
            $("input[id$='txtTargetDate']").datepicker("setDate", TargetDate);
       });
   </script>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900