We are creating a shopping cart for a small geographic area where we do local delivery with our own trucks. Internally we have already broken up these cities into zones. The problem with the built in 3 digit method is all of these cities share the first 3 digits despite being on completely different delivery routes. I need to change this to read all 5 digits.
In the appconfig I have changed the zipcodeprefixlength to 5. This is now throwing server errors so there must be some place in the code I need to change it. Any suggestions?
Here is the error:
Server Error in '/AspDotNetStorefrontML9' Application.
Index and length must refer to a location within the string.
Parameter name: length
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.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length]
System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) +10081476
AspDotNetStorefrontCore.Shipping.ZoneLookup(String zip) in C:\workspace\C#\shoppingcartv9\ASPDNSFCore\Shippin g.cs:214
AspDotNetStorefrontCore.Prices.ShippingTotal(Boole an includeDiscount, Boolean includeTax, CartItemCollection cic, Customer ThisCustomer, IEnumerable`1 OrderOptions) in C:\workspace\C#\shoppingcartv9\ASPDNSFCore\Prices. cs:706
AspDotNetStorefrontCore.Prices.Total(Boolean includeDiscount, CartItemCollection cic, Customer ThisCustomer, IEnumerable`1 OrderOptions) in C:\workspace\C#\shoppingcartv9\ASPDNSFCore\Prices. cs:926
AspDotNetStorefrontCore.ShoppingCart.get_TotalRate () in C:\workspace\C#\shoppingcartv9\ASPDNSFCore\Shoppin gCart.cs:516
AspDotNetStorefrontCore.ShoppingCart.get_TotalRate DisplayFormat() in C:\workspace\C#\shoppingcartv9\ASPDNSFCore\Shoppin gCart.cs:532
AspDotNetStorefrontControls.CartSummary.AssignData SourceContentToControls(ShoppingCart cart) in C:\workspace\C#\shoppingcartv9\ASPDNSFControls\Car tSummary.cs:409
AspDotNetStorefrontControls.CartSummary.CreateChil dControls() in C:\workspace\C#\shoppingcartv9\ASPDNSFControls\Car tSummary.cs:78
System.Web.UI.Control.EnsureChildControls() +146
System.Web.UI.Control.PreRenderRecursiveInternal() +61
System.Web.UI.Control.PreRenderRecursiveInternal() +224
System.Web.UI.Control.PreRenderRecursiveInternal() +224
System.Web.UI.Control.PreRenderRecursiveInternal() +224
System.Web.UI.Control.PreRenderRecursiveInternal() +224
System.Web.UI.Control.PreRenderRecursiveInternal() +224
System.Web.UI.Control.PreRenderRecursiveInternal() +224
System.Web.UI.Control.PreRenderRecursiveInternal() +224
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3394