Server Error in '/' Application.

Non-static method requires a target.

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.Reflection.TargetException: Non-static method requires a target.

Source Error:


Line 110:            });
Line 111:
Line 112:            lvwItems.DataSource = query.OrderByDescending(p => p.LikeCount).ThenByDescending(p => p.Id).ToList();
Line 113:            lvwItems.DataBind();
Line 114:

Source File: c:\inetpub\vhosts\azmoon-co.com\httpdocs\fa\products\product-subgroup\Default.aspx.cs    Line: 112

Stack Trace:


[TargetException: Non-static method requires a target.]
   System.Reflection.RuntimeMethodInfo.CheckConsistency(Object target) +14509309
   System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +154
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +96
   System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index) +34
   System.Data.Objects.ELinq.QueryParameterExpression.TryGetFieldOrPropertyValue(MemberExpression me, Object instance, Object& memberValue) +225
   System.Data.Objects.ELinq.QueryParameterExpression.TryEvaluatePath(Expression expression, ConstantExpression& constantExpression) +406
   System.Data.Objects.ELinq.QueryParameterExpression.EvaluateParameter(Object[] arguments) +124
   System.Data.Objects.ELinq.ELinqQueryState.GetExecutionPlan(Nullable`1 forMergeOption) +1514
   System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) +212
   System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() +40
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +416
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +70
   products_product_subgroup_Default.BindProducts() in c:\inetpub\vhosts\azmoon-co.com\httpdocs\fa\products\product-subgroup\Default.aspx.cs:112
   products_product_subgroup_Default.Page_Load(Object sender, EventArgs e) in c:\inetpub\vhosts\azmoon-co.com\httpdocs\fa\products\product-subgroup\Default.aspx.cs:81
   System.Web.UI.Control.OnLoad(EventArgs e) +106
   System.Web.UI.Control.LoadRecursive() +68
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3785


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