Server Error in '/' Application.

Collection index must be in the range 1 to the size of the collection.

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.IndexOutOfRangeException: Collection index must be in the range 1 to the size of the collection.

Source Error:


Line 409:							entThisMat = new LOG.GNPFrame.clsMat(me.Con, session("DefaultId_Mat").ToString)
Line 410:						else
Line 411:							entThisMat = new LOG.GNPFrame.clsMat(me.Con, entThisProductCategory.AvailableMatsCollection.ItemByPosition(1).Id)
Line 412:						end if
Line 413:					elseif Integer.TryParse(request("Id_Mat"), 0) then

Source File: D:\Inetpub\wwwroot\GNPFrame\App_Code\libFunctions.2.vb    Line: 411

Stack Trace:


[IndexOutOfRangeException: Collection index must be in the range 1 to the size of the collection.]
   Microsoft.VisualBasic.Collection.IndexCheck(Int32 Index) +711668
   Microsoft.VisualBasic.Collection.get_Item(Int32 Index) +21
   LOG.GNPFrame.clsMatCollection.get_ItemByPosition(Int32 entPosition) +60
   LOG.ThisWeb.clsMyWebPage.ProductConfigureSetUpObjects(clsProduct& entThisProduct, clsProductCategory& entThisProductCategory, clsLayout& entThisLayout, clsMoulding& entThisMoulding, clsMat& entThisMat, clsProductCustomized& entThisProductCustomized) in D:\Inetpub\wwwroot\GNPFrame\App_Code\libFunctions.2.vb:411
   ProductConfigure.Page_Load(Object sender, EventArgs e) in D:\Inetpub\wwwroot\GNPFrame\ProductConfigure.aspx.vb:22
   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.3905.0