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 8774531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:35:30+00:00 2026-06-13T18:35:30+00:00

I am posting some things to the database via AJAX and the C# code

  • 0

I am posting some things to the database via AJAX and the C# code in the App_Code folder in my ASP.NET WebPages website is what will be doing this.

My question is, what do I use as the file path for the ajax part?

xmlhttp.open("POST", "App_Code/MyClass/MyMethod()");?

Obviously this doesn’t work since it’s wrong, but I cannot find any sources to confirm how to do this. I know it can be done because I found a code sample on SO months ago, but I can no longer find it.

  • 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-13T18:35:31+00:00Added an answer on June 13, 2026 at 6:35 pm

    There is no way to directly request contents in App_code since it’s a protected folder.

    Instead you should have a .cshtml file that makes use of your class located in the App_code and then call that from your Ajax function. The URL passed to the Ajax call is simply that of the .cshtml file. You can pass parameters to the .cshtml file as form data, query string values or as UrlData.

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

Sidebar

Related Questions

hi guys i'm posting some data to controller using jquery ajax, but i am
I am posting some data using ajax. I want to manipulate that data and
In my java code,I am retrieving some multibyte data from database and making some
I'm porting some PHP to C++. Some of our database code stores time values
I'm posting data to a page called process.aspx that handles some business logic with
When posting from JS, PHP (5.3.8) returns some line returns in excess. For example:
I have been posting on my blog http://www.prashantraju.com/ since Jan 2010 however for some
It came to my attention a while ago that some people were posting images
I'm porting some WPF code to WinRT. The code uses System.Windows.Media.Animation.ParallelTimeline to syncrhonize two
I'm porting some code from other language to Ruby, in my Class I need

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.