Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to connect calendar to textbox in asp.net , so that user can give date dynamically...and how to store only date and only time in database( for me it is storing like 07-11-2012 00:00:00, time- 12.33.1223321)
Posted
Updated 6-Nov-12 20:13pm
v2
Comments
Sanjay K. Gupta 7-Nov-12 2:19am    
Use CalendarExtender of Ajax. you can give the format as you want. You can also separate the Date and Time Values
Mohd. Mukhtar 7-Nov-12 2:33am    
what have you tried?

Ajax Calendar Control[^]

and for Date Time Can tel me what data type u r using or u want ur time and date in different filed?/
 
Share this answer
 
use this function :-

XML
<script type="text/javascript">
        function pageLoad() {
            $(function() {
                $('.Calender').datepicker({
                    showButtonPanel: true,
                    dateFormat: "d-M-y",
                    showAnim: "slide",
                    changeMonth: true,
                    changeYear: true,
                    showOn: "button",
                    buttonImage: "Images/calender.png",
                    buttonImageOnly: true,
                    maxDate: "today",
                    showButtonPanel: true
                });
            });
        }
    </script>

VB
<asp:TextBox ID="txtordedt" runat="server" CssClass="Calender input-short"
                                    Width="150px" TabIndex="1"  />


now u can modify dataFormat in javascript fuction

please insert jquery-1.4.1.min.js and jquery-ui-1.7.1.custom.min.js.

Thank You
 
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