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 117:        {
Line 118:            Destination = Page.RouteData.Values["DestinationName"].ToString();
Line 119:            Destination = Destination.Substring(0, Destination.LastIndexOf('-'));
Line 120:            Destination = Destination.Replace("-", " ");
Line 121:

Source File: d:\Gewan CMS -Static Projects\ASP.Net- Web Sites With DB\altayer-travel.com\altayer\holiday_destination.aspx.cs    Line: 119

Stack Trace:


[ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length]
   System.String.Substring(Int32 startIndex, Int32 length) +14342605
   holiday_destination.bindmainhead() in d:\Gewan CMS -Static Projects\ASP.Net- Web Sites With DB\altayer-travel.com\altayer\holiday_destination.aspx.cs:119
   ASP.holiday_destination_aspx.__RenderContent1(HtmlTextWriter __w, Control parameterContainer) in d:\Gewan CMS -Static Projects\ASP.Net- Web Sites With DB\altayer-travel.com\altayer\holiday_destination.aspx:27
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +276
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   ASP.masterpage_master.__Renderform1(HtmlTextWriter __w, Control parameterContainer) in d:\Gewan CMS -Static Projects\ASP.Net- Web Sites With DB\altayer-travel.com\altayer\MasterPage.master:391
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +276
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +11661639
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +47
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +53
   ASP.masterpage_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\82c21535\edb6bfa5\App_Web_masterpage.master.cdcab7d2.ux3wldnj.0.cs:0
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +276
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.Page.Render(HtmlTextWriter writer) +40
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4239


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