Solved

Setting a default date for a calendar

Posted on 2004-08-12
3
242 Views
Last Modified: 2010-04-15
Anyone know how to set System.Web.UI.WebControls.Calendar to today's date?

and also how do I parse a dateTime value from the database to set the calendar?
0
Comment
Question by:jayrod
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
jkrill earned 250 total points
Comment Utility
System.Web.UI.WebControls.Calendar cal = new System.Web.UI.WebControls.Calendar();
cal.SelectedDate = DateTime.Now;

And to parse a DateTime string:

string myDateAsString = "1/1/2004";
DateTime aDate = DateTime.Parse(myDateAsString);
0
 
LVL 3

Author Comment

by:jayrod
Comment Utility
once I reparse and get aDate.. can I use it the same way I use DateTime.Now to reset the calendar?
0
 
LVL 2

Expert Comment

by:jkrill
Comment Utility
Yes.  DateTime.Now simply returns a DateTime object initialized with the current date and time.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now