Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

Can anybody help to find the answer.

In asp.net inside textbox I want a calender. Means when I click on textbox calender should be displayed.

How I will get..please reply

Regards,
Apali
Posted
Updated 16-Jul-13 21:25pm
v2
Comments
jaideepsinh 17-Jul-13 3:27am    
Hello apali,
Did you try ajax control for this?
Apali 17-Jul-13 3:44am    
its not working...i tried like this
<head runat="server">
<title></title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/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.3/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script type="text/javascript" language="javascript">
$(function () {
$("#TextBox1").datepicker({
changeMonth: true,
changeYear: true
});
});
$(function () {
$(".TextBox2").datepicker({
changeMonth: true,
changeYear: true
});
});
</script>
here for 1st textbox i am getting calender but for 2nd i am not getting..
crazie.coder 17-Jul-13 3:31am    
if you are using ajax calender extender
you can use

<asp:TextBox ID="TextBox1" runat="server">
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TextBox1" />

get more detail from here
http://www.dotnetcurry.com/ShowArticle.aspx?ID=149
jaideepsinh 17-Jul-13 3:47am    
This one is very simple to understand ajax.
http://www.asp.net/ajaxlibrary/ajaxcontroltoolkitsamplesite/

try this..:)

HTML
<html lang="en">
<head>
  <meta charset="utf-8" />
  <title>jQuery UI Datepicker - Default functionality</title>
  <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/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.3/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css" />
  <script>
  $(function() {
    $( "#datepicker" ).datepicker();
  });
  </script>
</head>
<body>
 
<p>Date: <input type="text" id="datepicker" /></p>
 
 
</body>
</html>


reference

http://jqueryui.com/datepicker/[^]
 
Share this answer
 
v2
Comments
Apali 17-Jul-13 3:33am    
<script type="text/javascript" language="javascript">
$(function () {
$("#TextBox1").datepicker({
changeMonth: true,
changeYear: true
});
});
$(function () {
$(".TextBox2").datepicker({
changeMonth: true,
changeYear: true
});
});
</script>

I used this code...anyhing is wrong??
Nirav Prabtani 17-Jul-13 3:34am    
yes try this..:)

<script type="text/javascript" language="javascript">
$(function () {
$("#TextBox1").datepicker({
changeMonth: true,
changeYear: true
});
});
$(function () {
$("#TextBox2").datepicker({
changeMonth: true,
changeYear: true
});
});
</script>

notice that ID of textbox must be TextBox2 and give proper links of jquery.
Apali 17-Jul-13 3:37am    
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/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.3/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />

is this necessary??
Nirav Prabtani 17-Jul-13 5:04am    
yes this is necessary.
Apali 17-Jul-13 3:45am    
Hi Nirav,
its not working...i tried like this

<head runat="server">
<title></title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/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.3/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script type="text/javascript" language="javascript">
$(function () {
$("#TextBox1").datepicker({
changeMonth: true,
changeYear: true
});
});
$(function () {
$(".TextBox2").datepicker({
changeMonth: true,
changeYear: true
});
});
</script>
here for 1st textbox i am getting calender but for 2nd i am not getting..
 
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