locked
Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index RRS feed

  • Question

  • User-352524747 posted

    i have in one page the code for letting users upload a file and also the code for managing roles.

    if i edit users role, add or remove from one role, i get this error :

    Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index

    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: index

    Source Error: 

    Line 74:     if (IsPost) {
    Line 75:         var fileSavePath = "";
    Line 76: var uploadedFile = Request.Files[1]; Line 77:         fileName = Path.GetFileName(uploadedFile.FileName);
    Line 78:         fileSavePath = Path.Combine(coursesRoot, fileName);

    How to solve this?

    Friday, July 8, 2011 5:49 PM

Answers

  • User-330204900 posted

    is this regarding the Dynamic Data framework?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, July 8, 2011 6:05 PM
  • User-352524747 posted

    Ups, im sorry, i posted this by mistake here!

    Pls, remove this.

    Thanks

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, July 9, 2011 7:47 AM

All replies

  • User-330204900 posted

    is this regarding the Dynamic Data framework?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, July 8, 2011 6:05 PM
  • User-352524747 posted

    Ups, im sorry, i posted this by mistake here!

    Pls, remove this.

    Thanks

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, July 9, 2011 7:47 AM