Server Error in '/' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 117: where product.ProductId == productId Line 118: select product).ToList().FirstOrDefault(); Line 119: Label1.Text = productInfoDetails.ProductName; Line 120: Label2.Text = productInfoDetails.WeightVal; Line 121: Image1.ImageUrl = "Products/" + productInfoDetails.ProductImage;

Source File: c:\inetpub\vhosts\gfree.co.il\httpdocs\ProductInfo.aspx.cs    Line: 119

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.] ProductInfo.loadProductDetails(gfreeDataClassesDataContext db, Int32 productId) in c:\inetpub\vhosts\gfree.co.il\httpdocs\ProductInfo.aspx.cs:119 ProductInfo.Page_Load(Object sender, EventArgs e) in c:\inetpub\vhosts\gfree.co.il\httpdocs\ProductInfo.aspx.cs:14 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.8974; ASP.NET Version:2.0.50727.8975