C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Tools and Utilities » ASP.NET »

Calender Control Using Ajax


Posted Date: 13 Jun 2009    Resource Type: Tools and Utilities    Category: ASP.NET
Author: Apul VyasMember Level: Gold    
Rating: 1 out of 5Points: 5



Here i am posting code for calender control using ajax, in which we can select by day, by week and by month.

The code is as shown or you can get the attached file for the project

<%@ Page Language="C#" %>

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>



<script runat="server">

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
_cal.SelectionMode = CalendarSelectionMode.None;
}
}

protected void _cal_SelectionChanged(object sender, EventArgs e)
{
_message.Text = "You have selectecd : ";
foreach (DateTime t in _cal.SelectedDates)
{
_message.Text += "<br>"+t.Date.ToShortDateString();
}

}

protected void _none_Click(object sender, EventArgs e)
{
_cal.SelectionMode = CalendarSelectionMode.None;
}

protected void _day_Click(object sender, EventArgs e)
{
_cal.SelectionMode = CalendarSelectionMode.Day;
}

protected void _week_Click(object sender, EventArgs e)
{
_cal.SelectionMode = CalendarSelectionMode.DayWeek;
}

protected void _month_Click(object sender, EventArgs e)
{
_cal.SelectionMode = CalendarSelectionMode.DayWeekMonth;
}
</script>

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

<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<br />
<br />
<asp:UpdatePanel ID = "updt" runat ="server">
<ContentTemplate>
<table style="width: 382px">
<tr>
<td rowspan=5>
<asp:Calendar ID="_cal" runat="server" OnSelectionChanged="_cal_SelectionChanged" />
</td>
<td style="width: 207px">
 Select By</td>
</tr>
<tr>
<td style="width: 207px">
<asp:Button ID="_none" Text="None" runat="server" OnClick="_none_Click" Width="51px" /></td>
</tr>
<tr>
<td style="width: 207px">
<asp:Button ID="_day" Text="Day" runat="server" OnClick="_day_Click" Width="51px" />
</td>
</tr>
<tr>
<td style="width: 207px">
<asp:Button ID="_week" Text="Week" runat="server" OnClick="_week_Click" Width="53px" />
</td>
</tr>
<tr>
<td style="width: 207px">
<asp:Button ID="_month" Text="Month" runat="server" OnClick="_month_Click" />
</td>
</tr>
</table>
<hr />
<asp:Label ID="_message" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
<asp:ImageButton ID="ImageButton1" runat="server" Height="333px" ImageUrl="~/loading.gif" Width="394px" />

</ProgressTemplate>
</asp:UpdateProgress>
 <br />
</div>

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


Attachments

  • Calender Control Using Ajax (29176-13910-AJAXEnabledWebSite1.rar)


  • Responses

    Author: Miss Meetu Choudhary    11 Jul 2009Member Level: Diamond   Points : 2
    Hi Apul Vyas,

    I have modified your resource and approving it. but it would be better that you should be careful in providing the contents of the articles. only attachments are not considered a good article.

    Hope you understand this and help us in future. by posting well formatted and good articles.


    ++
    Thanks and Regards.
    Meetu Choudhary.
    Site Coordinator.


    Feedbacks      
    Popular Tags   What are tags ?   Search Tags  
    Sign In to add tags.
    Calander  .  Asp.net  .  Ajax  .  

    Post Feedback


    This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
    You must Sign In to post a response.
    Next Resource: Donload AJAX Control Toolkit
    Previous Resource: Asp.Net Interview Question
    Return to Discussion Resource Index
    Post New Resource
    Category: ASP.NET


    Post resources and earn money!
     
    More Resources



    dotNet Slackers

    About Us    Contact Us    Privacy Policy    Terms Of Use