mayur pandit

mayur pandit

  • 1.4k
  • 337
  • 61.6k

session becoming automatically null

Nov 27 2018 9:32 AM
getting below error : 
An exception of type 'System.NullReferenceException' occurred in App_Code.xdxzpwdw.dll but was not handled in user code
Additional information: Object reference not set to an instance of an object.
 
description :
 
below code working fine in other classes but in one class session becommig null automatically.
I am passing post request using ajax and uploading image and deleting image also same time.
Kindly check below code. I did not understand why this problem is occuringexatly. Kindly help.
 
code details : 
public object BL_product_InsertUpdate(tbl_product product)//BL_admin_userInsertUpdate
{
   string message = string.Empty;
   if (!string.IsNullOrEmpty(HttpContext.Current.Session["UserName"].ToString()))
   {
   }
 }

Attachment: error.zip

Answers (6)