Is there a way to bind a Calendar to a SqlDataSource? I like to create a calendar where if there is an event scheduled it will show up as highlighted on the calendar. Help is much appreciated.
First error:
Error 1 Cannot convert method group 'ToShortDateString' to non-delegate type 'System.DateTime'. Did you intend to invoke the method? U:\eventCal.aspx.cs 25 25 U:\
On this line:
dateStart = dateStart.ToShortDateString;
Second error:
Error 2 Operator '==' cannot be applied to operands of type 'string' and 'method group' U:\eventCal.aspx.cs 31 17 U:\
On this line:
if (e.Day.Date.Day.ToString() == dateStart.ToString)
YOu have to make sure your datatypes match. Obviously there is a problem where you have vars defined as date or datetime and some as string. Go through and make them consistant.
if (e.Day.Date.Day.ToString() == Convert.ToString(Eval("mtgDateStart")))
{
e.Cell.BackColor = Color.Navy;
}
I do not get any error during compilation but I received this error when viewing through IE.
Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.
Source Error:
Line 29: //string dateEnd = Eval("mtgDateEnd");
Line 30:
Line 31: if (e.Day.Date.Day.ToString() == Convert.ToString(Eval("mtgDateStart")))
Line 32: {
Line 33: e.Cell.BackColor = Color.Navy;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.