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 39:         if (!IsPostBack)
Line 40:         {
Line 41:             var titulo = ((Literal)FormView1.FindControl("LiteralTitulo")).Text;
Line 42:             var nome = ((Literal)FormView1.FindControl("LiteralNome")).Text;
Line 43:             var descricao = ((Literal)FormView1.FindControl("descricaoLabel")).Text;

Source File: D:\inetpub\wwwroot\sba_arroba_2022\produto.aspx.cs    Line: 41

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   produto.FormView1_DataBound(Object sender, EventArgs e) in D:\inetpub\wwwroot\sba_arroba_2022\produto.aspx.cs:41
   System.Web.UI.WebControls.BaseDataBoundControl.OnDataBound(EventArgs e) +125
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +133
   System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +105
   System.Web.UI.Control.EnsureChildControls() +106
   System.Web.UI.Control.PreRenderRecursiveInternal() +57
   System.Web.UI.Control.PreRenderRecursiveInternal() +226
   System.Web.UI.Control.PreRenderRecursiveInternal() +226
   System.Web.UI.Control.PreRenderRecursiveInternal() +226
   System.Web.UI.Control.PreRenderRecursiveInternal() +226
   System.Web.UI.Control.PreRenderRecursiveInternal() +226
   System.Web.UI.Control.PreRenderRecursiveInternal() +226
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3670


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4700.0