Direct link into calendar control

P

Peer K

Hello,

This is driving me nuts! It's a bit hard to explain so please bare with me.

I have an ASP.NET page that uses the calendar control. I use DayRender
to set specific days selectable depending on data in a database. Works fine.

I want to be able to give a user a direct link that shows content for a
specified date - AND sets the calendar control to that date. I've done
this by making a direct link in the form http:/blabla/?day=2004-11-30.
This also works fine IF it is in the current month.

If, however, the link says http://blabla/?day=2004-10-10 (when we're in
november or december) the calendar doesn't work - it's stuck on
currentmonth.

When I receive an incoming request, I check for the "day" argument... e.g. :

------------
if(!this.IsPostBack)
{
if (Request.QueryString["day"] != null)
{
myDateTime = Convert.ToDateTime(Request.QueryString["day"]);

clndMenu.SelectedDate =
Convert.ToDateTime(myDateTime.ToString("yyyy-MM-dd"));

// Get content from database

------------

It leaves the calendar pointing to current month (December) - not the
month I asked for with SelectedDate. Is the DayRender event being called
before I get a chance to modify anything? What can I do if that is the case?

Note that if I load the page per default, select the month before now,
and click a date everything works fine (using the VisibleMonthChanged
and SelectionChanged events).

Hope that someone understands this and has a solution!

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,056
Members
48,769
Latest member
Clifft

Latest Threads

Top