Click here to Skip to main content
11,411,494 members (65,614 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
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 16-Jul-13 22:21pm
Apali358
Edited 16-Jul-13 22:25pm
v2
Comments
jaideepsinh at 17-Jul-13 3:27am
   
Hello apali,
Did you try ajax control for this?
Apali at 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..
Juhi Paunikar at 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 at 17-Jul-13 3:47am
   
This one is very simple to understand ajax.
http://www.asp.net/ajaxlibrary/ajaxcontroltoolkitsamplesite/
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

try this..Smile | :)

 

 
<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/[^]
  Permalink  
v2
Comments
Apali at 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 at 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 at 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 at 17-Jul-13 5:04am
   
yes this is necessary.
Apali at 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..
Nirav Prabtani at 17-Jul-13 5:04am
   
why are you putting . instead of # ???
Apali at 17-Jul-13 5:06am
   
ya by mistakely i put . ...now its working ..Thanks a lot Nirav...You know crystal Report??
Nirav Prabtani at 17-Jul-13 5:09am
   
yes but for this you have to put new question.
Apali at 17-Jul-13 5:12am
   
ya i already put now..please check once..
Nirav Prabtani at 17-Jul-13 5:05am
   
you should code
$(function () {
$("#TextBox2").datepicker({
changeMonth: true,
changeYear: true
});
});
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  

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

  Print Answers RSS
0 OriginalGriff 223
1 Sergey Alexandrovich Kryukov 195
2 Sascha Lefévre 155
3 ProgramFOX 90
4 Dave Kreskowiak 90
0 Sergey Alexandrovich Kryukov 8,920
1 OriginalGriff 7,128
2 Maciej Los 3,440
3 Abhinav S 3,248
4 Peter Leow 3,059


Advertise | Privacy | Mobile
Web04 | 2.8.150414.5 | Last Updated 17 Jul 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100