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 48:         MAcroCatego = info4lab.FunzioniGenerali.RewriteString(MAcroCatego);
Line 49:         string[] FirstSubCatego = shp1.FirstSubCategoBrandMacrocatego(CategoId, Convert.ToInt32(BrandId), Convert.ToInt32(MacroCatego));
Line 50:         ReTString = MAcroCatego + "/" + BrandRwName + "/" + BrandId + "/" + Catego[1].ToString() + "/" + Catego[0].ToString() + "/" + FirstSubCatego[1].ToString() + "/" + FirstSubCatego[0].ToString();
Line 51:         //if (shp1.FirstBrandCatego(Convert.ToInt16(BrandLabel.Text), Convert.ToInt16(MacroCategoLabel.Text)) == CategoryId)
Line 52:         //{

Source File: \\wagner\wwwroot$\d3cb18c97.hostnd\htdocs\www\controls\PLS_MenuCatalogo.ascx.cs    Line: 50

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   controls_PLS_MenuCatalogo.GetGerarchia(Int32 BrandId, Int32 MacroCatego, String BrandRwName) in \\wagner\wwwroot$\d3cb18c97.hostnd\htdocs\www\controls\PLS_MenuCatalogo.ascx.cs:50
   ASP.controls_pls_menucatalogo_ascx.__DataBind__control21(Object sender, EventArgs e) in \\wagner\wwwroot$\d3cb18c97.hostnd\htdocs\www\controls\PLS_MenuCatalogo.ascx:89
   System.Web.UI.Control.OnDataBinding(EventArgs e) +86
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +154
   System.Web.UI.Control.DataBind() +17
   System.Web.UI.Control.DataBindChildren() +187
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +164
   System.Web.UI.Control.DataBind() +17
   System.Web.UI.WebControls.ListView.CreateItemsWithoutGroups(ListViewPagedDataSource dataSource, Boolean dataBinding, InsertItemPosition insertPosition, ArrayList keyArray) +855
   System.Web.UI.WebControls.ListView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +1104
   System.Web.UI.WebControls.ListView.PerformDataBinding(IEnumerable data) +35
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +133
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +34
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +151
   System.Web.UI.WebControls.ListView.PerformSelect() +104
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +76
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +114
   System.Web.UI.WebControls.ListView.CreateChildControls() +56
   System.Web.UI.Control.EnsureChildControls() +97
   System.Web.UI.Control.PreRenderRecursiveInternal() +42
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +906


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