GridWeb breaks Request["

Hi!


As soon as I add a GridWeb to a form then the following line of code throws a “object reference not set to an instance of an object” error:

string graphType = HttpContext.Current.Request[“GraphType”].ToString();

As soon as I remove the GridWeb then I no longer get the error.

Please help,
Steph

Hi,

Thanks for your posting and using Aspose.Cells.

I have uploaded the sample project. Please download it and try at your end. It uses the latest version:
Aspose.Cells for .NET 8.7.1. It uses the following code and there is no object reference exception.

Once you will run the project successfully, it will show gridweb as shown in the screenshot.

C#

protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack == false && GridWeb1.IsPostBack == false)
{
if(HttpContext.Current.Request[“GraphType”]!=null)
{
string graphType = HttpContext.Current.Request[“GraphType”].ToString();

}

GridWorksheet sheet = GridWeb1.WorkSheets[0];
sheet.Cells[“B4”].PutValue(“Goodness”);

}
}