Server Error in '/CongratsCards' 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 9:  
Line 10:         Dim Category = (From c In db.Categories Where c.IsDeleted = False And c.UniqueIdentity = Request.QueryString("ID")).SingleOrDefault
Line 11:         txtcategoryName.InnerText = Category.CategoryName
Line 12:         Me.Title = "" + Category.CategoryName + " | بطاقات تهنئة جامعة تبوك"
Line 13: 

Source File: C:\inetpub\wwwroot\CongratsCards\pages\Category.aspx.vb    Line: 11

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   pages_Category.pages_CategoryBranch_Load(Object sender, EventArgs e) in C:\inetpub\wwwroot\CongratsCards\pages\Category.aspx.vb:11
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +67
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1435


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