Server Error in '/' Application.

Length cannot be less than zero.
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: Length cannot be less than zero.
Parameter name: length

Source Error:


Line 692:                nombre += nom[i] + "-";
Line 693:        }
Line 694:        nombre = nombre.Substring(0, nombre.Length - 1);
Line 695:
Line 696:        valor = nombre.Replace(" ", "-");

Source File: h:\webspace\hostings\hotelfloridatossa.com\hosting\www\App_Code\HotelFlorida.cs    Line: 694

Stack Trace:


[ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length]
   System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) +7711479
   System.String.Substring(Int32 startIndex, Int32 length) +11
   HotelFlorida.GeneraNombre(String nombre) in h:\webspace\hostings\hotelfloridatossa.com\hosting\www\App_Code\HotelFlorida.cs:694
   inc_cabecera.CargaEnlacesIdioma() in h:\webspace\hostings\hotelfloridatossa.com\hosting\www\inc\cabecera.ascx.cs:118
   inc_cabecera.Carga() in h:\webspace\hostings\hotelfloridatossa.com\hosting\www\inc\cabecera.ascx.cs:77
   inc_cabecera.Page_Load(Object sender, EventArgs e) in h:\webspace\hostings\hotelfloridatossa.com\hosting\www\inc\cabecera.ascx.cs:20
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.9174; ASP.NET Version:2.0.50727.9175