Solved Error

Posted on 2014-08-18
Last Modified: 2014-08-25
Hi My sharepoint application geeting error below
Page Load -Index was outside the bounds of the array,Can some one show me where is error generating,
This is generating only one person machine (browser) other every one working fine. i can't debug the programme becuase its in the client side.No access at all.But i can see the error using in the error Table.( i generated Table for any error goes to that table)

 protected void Page_Load(object sender, EventArgs e)
                LblUserLoginError.Visible = false;
                ConnectionOpen = new Site();
                LoginRights UsernameFind = new LoginRights();

                string[] CurrentUsername = UsernameFind.CurrentUserName().Split('\\');

                //  public int SalesLoginRights(string Username, string Country,out string SalesID)

                string[] HomeBackGlobal = Regex.Split(HttpContext.Current.Request.Url.ToString(), "http://");
                string Test_SalesPagePath = "~/_layouts/Test_Global/Test_Sales.aspx?Hm=" + HomeBackGlobal[1];
                //Image_Country.ImageUrl =ConnectionOpen.CountryFlag( LblCountry.Text.ToString());
                LinkDashBoard.Text = "DashBoard -" + LblCountry.Text.ToString();

                //HttpContext context = HttpContext.Current;
                PropertyInfo isreadonly = typeof(System.Collections.Specialized.NameValueCollection).GetProperty("IsReadOnly", BindingFlags.Instance | BindingFlags.NonPublic);
                if (!((Page)System.Web.HttpContext.Current.CurrentHandler).IsPostBack)

                    if (HttpContext.Current.Request.QueryString["SalesID"] != null)
                        string tempValue = HttpContext.Current.Request.QueryString["SalesID"].ToString();
                        LblSalesID.Text = tempValue;

                        if (LblSalesID.Text.ToString() != "")
                            Sales FindTestName = new Sales();
                            string SalesPerosnFullname = FindTestName.SalesPersonName(LblSalesID.Text.ToString(), LblCountry.Text.ToString());

                            if (UserLoginType() == 1 || UserLoginType() == 3)

                                Sales cl_SalesPersons = new Sales();

                                DataTable tbSalesPerson = cl_SalesPersons.ConvertListToDataTable(cl_SalesPersons.FillAllSalesPerson(LblCountry.Text.ToString()));
                                DropDownTest.DataSource = tbSalesPerson;

                                DropDownTest.DataTextField = "Column1";
                                DropDownTest.DataValueField = "Column1";

                                DropDownTest.SelectedValue = SalesPerosnFullname;

                            if (UserLoginType() == 2)





                }//end of Ispost 

            catch (Exception PageErr)
                string ErrMessage="";
                ErrMessage ="Page Load -"+PageErr.Message.ToString()+"Source -"+ PageErr.Source.ToString() +"StackTrace -"+ PageErr.StackTrace.ToString();


Open in new window

Hope someone can show me where is the error or how to find the where is
Question by:ukerandi
    LVL 35

    Expert Comment

    by:Miguel Oz
    Please provide which line in Page_load  fails and the stack trace generated by the error.
    LVL 52

    Accepted Solution

    Well the error is indicating an array indexing issue, so the first obvious line that could trip that would be:
    string Test_SalesPagePath = "~/_layouts/Test_Global/Test_Sales.aspx?Hm=" + HomeBackGlobal[1];

    Open in new window

    But potentially any of your other function calls could have tripped it too, if they don't have any local exception handling at least.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Suggested Solutions

    The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video discusses moving either the default database or any database to a new volume.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now