Server Error in '/' Application.

Index was outside the bounds of the array.

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.IndexOutOfRangeException: Index was outside the bounds of the array.

Source Error:


Line 587:                {
Line 588:                    str = filename[i].Split('.');
Line 589:                    if (str[1].ToLower() == "pdf")
Line 590:                    {
Line 591:                        extention = "images/pdf.png";

Source File: e:\WebRoot\bbpayreseller\thairoad\trsl.thairoads.org\www\SearchSubject.aspx.cs    Line: 589

Stack Trace:


[IndexOutOfRangeException: Index was outside the bounds of the array.]
   SearchSubject.genLinkDownLoad(Object fileName, Object fileLocation, Object id) in e:\WebRoot\bbpayreseller\thairoad\trsl.thairoads.org\www\SearchSubject.aspx.cs:589
   ASP.searchsubject_aspx.__DataBind__control13(Object sender, EventArgs e) in e:\WebRoot\bbpayreseller\thairoad\trsl.thairoads.org\www\SearchSubject.aspx:100
   System.Web.UI.Control.OnDataBinding(EventArgs e) +132
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +170
   System.Web.UI.Control.DataBindChildren() +11162975
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +182
   System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +674
   System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +68
   SearchSubject.FetchData() in e:\WebRoot\bbpayreseller\thairoad\trsl.thairoads.org\www\SearchSubject.aspx.cs:143
   SearchSubject.Page_Load(Object sender, EventArgs e) in e:\WebRoot\bbpayreseller\thairoad\trsl.thairoads.org\www\SearchSubject.aspx.cs:26
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428


Version Information: Microsoft .NET Framework Version:2.0.50727.9061; ASP.NET Version:2.0.50727.9062