Server Error in '/' Application.

StartIndex cannot be less than zero.
Parameter name: startIndex

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

Source Error:


Line 24:       while (oPage.PageID == 0)
Line 25:       {
Line 26:         sURLToTry = sURLToTry.Remove(sURLToTry.LastIndexOf('/')) + ".aspx";
Line 27:         oPage = new page(sURLToTry);
Line 28:       }

Source File: c:\inetpub\vhosts\tipis4hire.com\httpdocs\template.aspx    Line: 26

Stack Trace:


[ArgumentOutOfRangeException: StartIndex cannot be less than zero.
Parameter name: startIndex]
   System.String.Remove(Int32 startIndex) +7032656
   ASP.template_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\inetpub\vhosts\tipis4hire.com\httpdocs\template.aspx:26
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +117
   System.Web.UI.Page.Render(HtmlTextWriter writer) +39
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +79
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8753


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