Click here to Skip to main content
12,885,022 members (30,120 online)
Rate this:
 
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 21:21pm
Apali358
Updated 16-Jul-13 21:25pm
v2
Comments
jaideepsinh 17-Jul-13 3:27am
   
Hello apali,
Did you try ajax control for this?
Juhi Paunikar 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
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..
jaideepsinh 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..:)

 

 
<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 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??
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..
Nirav Prabtani 17-Jul-13 5:04am
   
yes this is necessary.
Nirav Prabtani 17-Jul-13 5:04am
   
why are you putting . instead of # ???
Nirav Prabtani 17-Jul-13 5:05am
   
you should code
$(function () {
$("#TextBox2").datepicker({
changeMonth: true,
changeYear: true
});
});
Apali 17-Jul-13 5:06am
   
ya by mistakely i put . ...now its working ..Thanks a lot Nirav...You know crystal Report??
Nirav Prabtani 17-Jul-13 5:09am
   
yes but for this you have to put new question.
Apali 17-Jul-13 5:12am
   
ya i already put now..please check once..
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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.170424.1 | Last Updated 17 Jul 2013
Copyright © CodeProject, 1999-2017
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