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 99:                      <a href="<%: Url.Action("Index","Kategori",new { LINK = LINK})%>"><%: Model.URUN_KATEGORILER.SingleOrDefault(o => o.ID == Model.parent2).ACIKLAMA%></a> 
Line 100:                     <span class="icofont icofont-thin-right"></span> 
Line 101:                     <% LINK = Model.URUN_KATEGORILER.SingleOrDefault(o => o.ID == Model.parent1).LINK; %>
Line 102:                     <a href="<%: Url.Action("Index","Kategori",new { LINK = LINK})%>">
Line 103:                      <%: Model.URUN_KATEGORILER.SingleOrDefault(o => o.ID == Model.parent1).ACIKLAMA%>

Source File: c:\Users\Togan\desktop\code\Views\Kategori\Index.aspx    Line: 101

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   ASP.views_kategori_index_aspx.__RenderContent2(HtmlTextWriter __w, Control parameterContainer) in c:\Users\Togan\desktop\code\Views\Kategori\Index.aspx:101
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +116
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +78
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +249
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +78
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +249
   System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) +74
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +78
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8752


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