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 25:{Line 26:                 Category cate = new CategoryBLL(AppContext.CurrentSiteID).GetByID(Convert.ToInt32(Request["CategoryID"])); Line 27:                 if (cate.ParentCateID == 0)  Line 28:{Line 29:                     lit_cateid.Text = "<input type='hidden'id='categoryid'value='"+ cate.CategoryID + "'/>";

Source File: e:\Websitepanel\Old-server\ttdoor\Controls\UCMenuProduct.ascx.cs   Line: 27

Stack Trace:

 [NullReferenceException: Object reference not set to an instance of an object.]
Controls_UCMenuProduct.Page_Load(Object sender, EventArgs e) in e:\Websitepanel\Old-server\ttdoor\Controls\UCMenuProduct.ascx.cs:27
System.Web.UI.Control.LoadRecursive() +70
System.Web.UI.Control.LoadRecursive() +189
System.Web.UI.Control.LoadRecursive() +189
System.Web.UI.Control.LoadRecursive() +189
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3177 


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