If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Calendar function in ASP.Net

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-15-05, 07:19
maireob maireob is offline
Registered User
 
Join Date: Dec 2004
Posts: 5
Calendar function in ASP.Net

Hi,

I'm building an ASP.Net application that connects to a SQL Server DB. I want one form of the application to display a calendar(preferably showing the current month and the next month only). The user should then be able to select multiple dates from the 2 months displayed. I'll then provide a submit button that will write these selected dates to the database. Can I use the Calendar provided in asp.net for this, if so how do I get this to allow the selection of multiple dates? And if I can't use this, what should I use instead, javascript?

All suggestions greatly appreciated!!
Reply With Quote
  #2 (permalink)  
Old 02-18-05, 07:31
sgmuse sgmuse is offline
Registered User
 
Join Date: Mar 2004
Location: London, UK
Posts: 71
yes you should be fine with using the .net calendar control.

be aware however that it's a web control so you will need to do your development strictly in visual studio for the pages where you place it.

i'm going to, i have a similar project to undertake.
Reply With Quote
  #3 (permalink)  
Old 02-22-05, 07:14
maireob maireob is offline
Registered User
 
Join Date: Dec 2004
Posts: 5
ASP.Net Calendar - Help Needed!

Thank you for your reply. I've have spent a considerable amount of time trying to get this to work but am still having problems. The calendar will only appear on one page of the application so thats not a problem. I want the user to be able to select multiple dates.

How do I keep track of dates that the user clicks on? I tried to write some code behind the Calendar1_SelectionChanged method as follows but nothing happens!!

private void Calendar1_SelectionChanged(object sender, System.EventArgs e)
{

string day = Calendar1.SelectedDate.ToShortDateString();

//here I am trying to add any date that the user picks on the calendar to
//the days arraylist(declared publically)

days.Add(day);
}


private void btnDate_Click(object sender, System.EventArgs e)
{
//testing to see if the array is filling - getting 0 so its not!

String d = days.Count.ToString();

lblDP.Text= "Number of elements in array: " + d;
}


Can anyone help?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On