I'm trying to assign a datatable value to a viewstate property but I'm receiving "The name ViewState does not exist in the current context". It appears to be an issue with the property. Does anyone know the cause of this issue?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
{
public partial class WebForm2 : System.Web.UI.Page
{
private System.Data.DataTable EmpData
{
get
{
DataTable o = ViewState("_EmpData");
if (o == null)
{
return null;
}
else
{
return o;
}
}
set { ViewState("_EmpData") = value; }
}
protected void Pa ...
Go to the complete details ...