Asp.NET Asp Click Error:button

Asked

Viewed 233 times

3

I have a screen where I have some buttons and clicking on the buttons returns me the error on the screen:

"Index was out of Range Must be non-negative and Less than the size of the Collection."

The strange thing is that in the event these buttons click there is a try/catch, and within the catch a method that logs errors occurring in the system.

Summarizing: is not entering "Click" event from button..

To make it difficult, the error only occurs in production, not in development.. and I have no way to access the production environment.

Doing some tests here found that if I access the system page using "https" the buttons work normally, already with the "http" of this error "index was out...". This error has started to occur since the last rise in production.

1 answer

0

The error is characteristic of trying to access some position of the Array with a negative index.

If the event does not arrive at the click, it is because before running the event Click, in the flow of Page, always run the event Page_load. So, there might be some code in this event that is causing the error.

If you post your code, we can solve with greater precision.

  • Doing some tests here found that if I access the system page using "https" the buttons work normally, already with the "http" of this error "index was out...".

  • Before this did not occur, we always accessed without the "https", because we even had problems with it.. and since the last ascent to production this has started to occur.. have you any idea of why? the network people say it’s something of the application..

  • It would have to send the code of what is done on the button and page_load?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.