Click here to Skip to main content
15,868,026 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi,

i want a calendar control in javascript and then want to plug in asp.net.. anyone help me for writing the code....
Posted

Hi Gopinath,
CP is such a wonderfull site before posting your question, try to search for the existing articles[^]
This is quite a basic question.
you can start from here A JavaScript Weekly Calendar[^]
 
Share this answer
 
v2
Comments
RaviRanjanKr 16-Dec-11 15:31pm    
My 5+
Pramod Harithsa 17-Dec-11 4:00am    
thanks :-)
Use jquery datepicker. Its very light weight and easy to integrate and use in you ASP.NET application.

Add following javascript.

JavaScript
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
   

<script type="text/javascript">
        $(function () {
            $("#<%=txtFromDate.ClientID %>").datepicker({ dateFormat: 'M dd, yy' });
        });
</script>


Then add Textbox that is to be used as calendar.

ASP.NET
<asp:textbox id="txtFromDate" runat="server" width="150px" xmlns:asp="#unknown"></asp:textbox>



On server side, you will easily get the selected date as txtFromDate.Text.
 
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