Server Error in '/' Application.

Index was out of range. Must be non-negative and less than the size of the collection.
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: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex

Source Error:


Line 298:                      // Response.Write("<script>alert(\"" + lb_dati.Text + "\");</script>");
Line 299:			           int idxStart = lb_dati.Text.IndexOf("<b>");
Line 300:                       int idxStop = lb_dati.Text.IndexOf("</b>", idxStart+2);
Line 301:                       //st = "<script id=\"srcComeRag\" src=\"http://www.gmodules.com/ig/ifr?url=http://hosting.gmodules.com/ig/gadgets/file/114281111391296844949/driving-directions.xml&amp;up_fromLocation=&amp;up_myLocations=" + lb_dati.Text.Substring(idxStart, idxStop - idxStart - 4).Replace(" ", "%20").Substring(3) +"&amp;up_defaultDirectionsType=&amp;synd=open&amp;w=610&amp;h=75&amp;brand=light&amp;lang=it&amp;country=ALL&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js\"></script>";
Line 302:                       st = "<script src=\"http://www.gmodules.com/ig/ifr?url=http://hosting.gmodules.com/ig/gadgets/file/114281111391296844949/driving-directions.xml&amp;up_fromLocation=&amp;up_myLocations=" + lb_dati.Text.Substring(idxStart, idxStop - idxStart - 4).Replace(" ", "%20").Substring(3) + "&amp;up_defaultDirectionsType=&amp;synd=open&amp;w=655&amp;h=75&amp;title=&amp;brand=light&amp;lang=it&amp;country=ALL&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js\"></script>";         

Source File: d:\inetpub\wwwroot\cercaturismo.it\PaginaStruttura.aspx    Line: 300

Stack Trace:


[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex]
   System.Globalization.CompareInfo.IndexOf(String source, String value, Int32 startIndex, Int32 count, CompareOptions options) +10177747
   System.Globalization.CompareInfo.IndexOf(String source, String value, Int32 startIndex) +44
   ASP.paginastruttura_aspx.__Renderform1(HtmlTextWriter __w, Control parameterContainer) in d:\inetpub\wwwroot\cercaturismo.it\PaginaStruttura.aspx:300
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +115
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +253
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +87
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +53
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +240
   System.Web.UI.Page.Render(HtmlTextWriter writer) +38
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4240


Version Information: Microsoft .NET Framework Version:2.0.50727.9055; ASP.NET Version:2.0.50727.9051