Server Error in '/' 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:


Line 362:        if (queryLang.Length > 2)
Line 363:        {
Line 364:            queryCountry = queryLang.Substring(3, 2);
Line 365:            queryLang = queryLang.Substring(0, 2);
Line 366:

Source File: C:\Inetpub\vhosts\dalgakiran.com\hertz-kompressoren.com\App_Code\Common.cs    Line: 364

Stack Trace:


[ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length]
   System.String.Substring(Int32 startIndex, Int32 length) +14599300
   Common.setLinkLang(String queryLang) in C:\Inetpub\vhosts\dalgakiran.com\hertz-kompressoren.com\App_Code\Common.cs:364
   ASP.global_asax.Session_Start(Object sender, EventArgs e) in C:\Inetpub\vhosts\dalgakiran.com\hertz-kompressoren.com\global.asax:54
   System.Web.SessionState.SessionStateModule.CompleteAcquireState() +375
   System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +1257
   System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +703
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +75
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +158


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