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

  • SEARCH
  • Home
  • 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 9013629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:18:57+00:00 2026-06-16T03:18:57+00:00

This is my WebMethod <WebMethod(Description:=Fetch Nested Albums, EnableSession:=True)> _ <ScriptMethod(ResponseFormat:=ResponseFormat.Json)> _ Public Function moveImages()

  • 0

This is my WebMethod

<WebMethod(Description:="Fetch Nested Albums", EnableSession:=True)> _
<ScriptMethod(ResponseFormat:=ResponseFormat.Json)> _
Public Function moveImages() As Object
    Dim FileCount As Integer = _
        HttpContext.Current.Request.Form(
            HttpContext.Current.Request.Form.Count - 2)
End Function

When i try to call the web service from the .aspx page i get this error

“Index was out of range. Must be non negative and less than the size of the collection.”

How can i access the request Object? I was not able to access the session object in the web method, so i had to add EnableSession:=True in the Web Method.

So is there any setting for the request Object too?

  • 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-06-16T03:18:58+00:00Added an answer on June 16, 2026 at 3:18 am

    I think that the error is very clear. In this line the .Count is less that 2.

    HttpContext.Current.Request.Form(HttpContext.Current.Request.Form.Count - 2)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<WebMethod(Description:=JSON Hierarchy Object)> _ <ScriptMethod(ResponseFormat:=ResponseFormat.Json)> _ Public Function xmlData() As Object Using _ds As
I have a simple .NET [asmx] web service setup like this: [WebMethod] [ScriptMethod(ResponseFormat =
I have a page with this method in CreateTicket.aspx.cs: [WebMethod()] public static string Categories()
Im trying to run a sipmle ASP.NET 2 Webmethod with JSON this is my
Ii have a web method that looks like this: [WebMethod] public int ImportData(System.Collections.Generic.List<Record> importRecords)
I've got a ASP.NET WebService that looks something like this: [WebMethod] public static void
I would like to return an ExpandoObject from a WebMethod, like this: [WebMethod] public
I have a method called getPersonInfo and it's header looks like this: [WebMethod] public
[WebMethod(Description = Return all activities by Task.)] public IList<ActivityDto> GetActivitiesByTaskID(int taskID) { IList<Activity> activities
I have function called getdoctor () in asmx file I wannna call this webmethod

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.