Can someone help with this error message. The error points to this line: DateTime tmpDate = Convert.ToDateTime(lblCalendarDate.Text).AddDays(-7);
I know it will be something to do with I have the date as a string in one method and the date as date in another method but I don't know how to rectify this seeing as I'm knew to ASP.Net & C#. Here is the code:
protected void btnPrevious_Click(object sender, EventArgs e)
{
SetLabelText(-7);
}
protected void btnNext_Click(object sender, EventArgs e)
{
SetLabelText(7);
}
private void SetLabelText(int daysToAdd)
{
daysToAdd = Convert.ToInt32(ViewState["days"]) + daysToAdd;
DateTime currentDate = DateTime.Now;
while (currentDate.DayOfWeek != DayOfWeek.Monday)
{
currentDate = currentDate.Add ...
Go to the complete details ...