Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4265864
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:40:55+00:00 2026-05-21T06:40:55+00:00

During local my system its working but when i uploaded it on-site i encountered

  • 0

During local my system its working but when i uploaded it on-site i encountered problem..
Do i need some dll?

Index was outside the bounds of the array.
Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.

Line 6:      if (Request.Params["mode"] != null) Mode = Request.Params["mode"];
Line 7:      if (!Path.Split('/')[3].Equals("Default.aspx") && (String)Session["accesslevel"] == ("0"))
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T06:40:56+00:00Added an answer on May 21, 2026 at 6:40 am

    If I had to guess I’d say it’s probably this:

    Path.Split('/')[3]
    

    If you’re running under http://localhost/myapp you’ll have more elements in the array after calling Path.Split than if you are running under http://www.myapp.com. Chances are you only have 3 elements in that array in production, not the 4 you probably have in dev.

    EDIT:

    For the page you posted, a call to Request.Path is going to return:

    "/backend/default.aspx"
    

    When you do a split on ‘/’, you’re only going to get back 3 elements:

    [0] = ""
    [1] = "backend"
    [2] = "default.aspx"
    

    That’s why Path.Split('/')[3] will throw an IndexOutOfRangeException. So the short answer is you should switch it to Path.Split('/')[2] in production, but a better solution would be to come up with a way where the case is handled using the same code in both environments.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a query that is working fine on my local but when placed
iPhone version - 5.1 (9B176) Below is the series of events during Local Notification
I'm trying to setup NServiceBus in Azure. During local development I am using the
I have a Windows service that runs as a logged-in user (local admin). During
During our build process, we run sqlldr to populate our database with some sample
I am almost finished with my game now, but today I encountered a real
I have a setup project, its been working nicely for atleast a couple of
I need to recover two Git branches that I somehow deleted during a push.
When I deploy my WAR generated with Ant on my local system (copy/paste under
During development of an mvc web application, I'm encourtering issues running the local instance

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.