In my view I'm using this line to go to another view when I click on a empty date in the DayPilotMonth calendar:
TimeRangeSelectedJavaScript = "document.location='Bokabord2?startingtime={0}';"
In my controller of this view I have this code:
DateTime startingtime;
if (Request.QueryString["startingtime"] != null)
{
startingtime = Convert.ToDateTime(Request.QueryString["startingtime"]);
startingtime.ToString("yyyyMMdd");
ViewBag.Message = startingtime;
}
else
{
ViewBag.Message = "Error";
}
But when I run the application I get error at the Convert.ToDateTime line.
The following error message pops up: An exception of type 'System.FormatException' occurred in mscorlib.dll but was not handled in user code
Additional information: String was not recognized as a valid DateTime.
Can someone give me a hint or something? Thanks in advance. :)