DISCLAIMER: I haven't tried this in practice. I've only browsed througr MVC source code and VS Help/MSDN.
OK. After disclaimer, let's do some work. Here is a decompiled source code for Eval metod that takes two arguments:
1 public string Eval(string expression, string format)
2 {
3 object obj2 = this.Eval(expression);
4 if (obj2 == null)
5 {
6 return string.Empty;
7 }
8 if (string.IsNullOrEmpty(format))
9 {
10 return Convert.ToString(obj2, CultureInfo.CurrentCulture);
11 }
12 return string.Format(CultureInfo.CurrentCulture, format, new object[] { obj2 });
13 }
Take atention to line 12 in this code fragment. It returns overload of String.Format that takes format string as an argument. From MSDN/VS Help:
public static string Format(
IFormatProvider provider,
string format,
Object[] args
)
and format is a composite format string -again from MSDN:
A composite format string and object list are used as arguments of methods
that support the composite formatting feature. A composite format string
consists of zero or more runs of fixed text intermixed with one or more format
items. The fixed text is any string that you choose, and each format item
corresponds to an object or boxed structure in the list. The composite
formatting feature returns a new result string where each format item is
replaced by the string representation of the corresponding object in the
list.
for example, in next code fragment, first argument is a composite format string . This page also contains examples of various usages of this argument.
1 string FormatString1 = String.Format("{0:dddd MMMM}", DateTime.Now);
In the end, you might use Eval like this:
EDIT: ViewData.Eval("{0:dddd MMMM}", NextReviewDate) - Arguments are in wrong order and NextReviewDate must be passed as string name, and not variable
ViewData.Eval("NextReviewDate", "{0:dddd MMMM}")
Dragan