How to use Calender controls.

Posted by Sathiya_Narayanan under ASP.NET on 7/10/2012 | Points: 10 | Views : 6024 | Status : [Member] | Replies : 13
Hi,
How to use calender controls, when user clicks the date month & year the selected it should displayed in the textbox and it to be saved in database in one column.










Thanks,

SATHIYANARAYANAN


Responses

Posted by: Patel28rajendra on: 7/10/2012 [Member] Starter | Points: 25

Up
0
Down
Hi
You can use Ajax Calendar Extender for that

refer this link for help

http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/Calendar/Calendar.aspx

Regards

R D Patel

Sathiya_Narayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sathiya_Narayanan on: 7/10/2012 [Member] Starter | Points: 25

Up
0
Down
Hi patel

I check the above link How to implement this i am new to AJAX.
pls tell some basics in AJAX.

SATHIYANARAYANAN

Sathiya_Narayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ranjeet_8 on: 7/10/2012 [Member] [MVP] Gold | Points: 25

Up
0
Down
Hi Sathiyanarayanan

Refer this URL.
http://www.codeproject.com/Articles/35455/Ajax-Calendar-Control

Sathiya_Narayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muralidosscm on: 7/10/2012 [Member] Starter | Points: 25
Posted by: Patel28rajendra on: 7/11/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

First you have to include Ajax toolkit in your visual studio toolbox and then you can put text box in page and on text box upper corner small arrow will be there click on that and click on add extender you will find different Extenders over there just add that
and don't forget to add script manager in your page.

you can also download Toolkit from that link


Regards



R D Patel

Sathiya_Narayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Patel28rajendra on: 7/11/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

see this link for how to add extender
http://www.asp.net/web-forms/tutorials/ajax-control-toolkit/getting-started/using-ajax-control-toolkit-controls-and-control-extenders-cs

After referring this you can add extender for calender

Regards

R D Patel

Sathiya_Narayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Megan00 on: 7/11/2012 [Member] Starter | Points: 25

Up
0
Down
Try the below code.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Canlendar.aspx.cs" Inherits="WebApplicationCanlendar.Canlendar" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="scriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Calendar runat ="server" ID ="calendar" onselectionchanged="calendar_SelectionChanged" ></asp:Calendar>
<br />
<asp:TextBox runat="server" ID="txtbox"></asp:TextBox>
<br />
</ContentTemplate>
</asp:UpdatePanel>

</div>
</form>
</body>
</html>


protected void calendar_SelectionChanged(object sender, EventArgs e)
{
this.txtbox.Text = this.calendar.SelectedDate.ToShortDateString();

}


Never give up! Smile to the world!
http://excelcsharp.blog.com/

Sathiya_Narayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Patel28rajendra on: 7/11/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

you can use the code posted by Megan00 i was telling the same

Regards

R D Patel

Sathiya_Narayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sathiya_Narayanan on: 7/12/2012 [Member] Starter | Points: 25

Up
0
Down
It shows no error but its not working when user click on to Textbox.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Test" %>
<%@ Register Assembly ="AjaxControlToolkit"Namespace="AjaxControlToolkit"Tagprefix="ajax" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>

</head>
<body>
<form id="form1" runat="server">
<div>

<ajax:ToolkitScriptManager ID="Toolkit" runat="server">
</ajax:ToolkitScriptManager>
<b> SelectDate</b><asp:TextBox ID="txtdate" runat="server"></asp:TextBox>

<ajax:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtdate" Format="dd/mm/yyyy">
</ajax:CalendarExtender>

</div>
</form>
</body>
</html>


SATHIYANARAYANAN

Sathiya_Narayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sathiya_Narayanan on: 7/12/2012 [Member] Starter | Points: 25

Up
0
Down
Hi rajendra i downloaded the ajax control toolkit from the above link, here i am using .net2.0
for that i downloaded 2.0 toolkit, in that i dont find .dll file how to add into the ajax control to tool box.
as in 3.5 only .dll is enough for using the toolkit, like how is for 2.0.





Thanks,

SATHIYANARAYANAN

Sathiya_Narayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Dotnetrajanikanth on: 7/12/2012 [Member] Starter | Points: 25

Up
0
Down
if you are facing trouble using ajax just go for jQuery.

http://jqueryui.com/demos/datepicker/

You need to add jquery and jquery ui files to your solution.

Jus see thhis link to know how to add jquery to your solution.

http://jqueryui.com/demos/datepicker/
http://docs.jquery.com/Tutorials

____________
www.flickr.com/photos/psdesigner/

Sathiya_Narayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Patel28rajendra on: 7/12/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

you just have to add .dll same
It would be in Bin Folder just Check

Regards

R D Patel

Sathiya_Narayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vamc on: 7/1/2014 [Member] Starter | Points: 25

Up
0
Down
See the below link to know about calender control with live example

http://www.dotnetchallengers.com/App_Folder/Content/Tutorials/ASPNET_CalenderControl.aspx



Sathiya_Narayanan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response