Я пытаюсь реализовать привязку модели, но получаю сообщение об ошибке: ModelBindingExecutionContext - это тип, но используется как переменная.Вот мой код: (Следует указать, что это для ASP.NET Web Form Application, а не MVC)
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.ModelBinding;
protected ActivityBO GetActivity()
{
ActivityBO activity = new ActivityBO();
//IValueProvider provider = new FormValueProvider(ModelBindingExecutionContext);
if (TryUpdateModel(activity, new FormValueProvider(ModelBindingExecutionContext)))
{
return activity;
}
else
{
//Error code will go here.
}
}