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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:42:28+00:00 2026-05-11T16:42:28+00:00

I’m doing some automation work and can make my way around a site &

  • 0

I’m doing some automation work and can make my way around a site & post to HTML forms okay, but now I’m up against a new challenge, Ajax forms.

Since there’s no source to read, I’m left wondering if it’s possible to fill in an Ajax form progamatically, in C#. I’m currently using a non-visible axWebBrowser.

Thanks in advance for your help!

  • 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-11T16:42:28+00:00Added an answer on May 11, 2026 at 4:42 pm

    Yes, but I recommend using a different approach to requesting/responding to the server pages including the regular pages, and the AJAX handler pages.

    In c#, try using the WebRequest/WebResponse or the more specialized HttpWebRequest/HttpWebResponse classes.

    Ajax is no more than a “fancy” name for a technology that allows Javascript to make HTTP requests to a server which usually implements some handlers that produce specialized, light-weight content for the Javascript caller (comonly encoded as JSON).

    Therefore in order to simulate AJAX calls, all you have to do is inspect your target application (the web page that you want to “post” to) and see what format is used for the AJAX communications – then replicate the page’s Javascript behavior from C# using the WebREquest/WebResponse classes.

    See Firebug – a great tool that allows you to inspect a web page to determine what calls it makes, to which pages and what those pages respond. It does a pretty good job at inspecting AJAX calls too.

    Here’s a very simple example of how to do a web request:

    HttpWebRequest wReq = (HttpWebRequest)WebRequest.Create("http://www.mysite.com");
    
    using (HttpWebResponse resp = (HttpWebResponse)wReq.GetResponse())
    {
       // NOTE: A better approach would be to use the encoding returned by the server in
       // the Response headers (I'm using UTF 8 for brevity)
       using (StreamReader sr = new StreamReader(resp.GetResponseStream(), Encoding.UTF8))
       {
           string content = sr.ReadToEnd();
           // Do something with the content
       }
    }    
    

    A POST is also a request, but with a different method. See this page for an example of how to do a very simple post.

    EDIT – Details on Inspecting the page behavior with Firebug

    What I mean by inspecting the page you’re trying to replicate is to use a tool (I use Firebug – on Firefox) to determine the flow of information between the page and the server.

    With Firebug, you can do this by using the “Net” and “Console” panels. The Net panel lists all requests executed by the browser while loading the page. While the “Console” will list communications between the page and the server that take place after the page has loaded. Those communications that take place after the page has loaded are essentially the AJAX calls that you’ll want to replicate (Note: Network monitoring has to be enbled in Firebug for this to work)

    Check out Michael Sync’s tutorial to learn more about Firebug and experiment with the Console panel to learn more about the AJAX requests.

    Regarding “replicate the page’s behavior from C# using the WebRequest/WebResponse” – what you have to realize is that like I said earlier, the Javascript AJAX call is nothing more than an HTTP Request. It’s an HTTP Request that the Javacript makes “behind the scenes”, or out-of-band, to the web server. To replicate this, it is really no different than replicating a normal GET or a normal POST like I showed above. And this is where Firebug comes in to play. Using it you can view the requests, as the Javascript makes them – look at the Console panel, and see what the Request message looks like.

    Then you can use the same technique as above, using the HttpWebRequest/HttpWebResponse to make the same type of request as the Javascript does, only do it from C# instead.

    Gregg, I hope this clarifies my answer a little bit but beyond this I suggest playing with Firebug and maybe learning more about how the HTTP protocol works and how AJAX works as a technology.

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

Sidebar

Ask A Question

Stats

  • Questions 237k
  • Answers 237k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you are going to be working with images you… May 13, 2026 at 6:37 am
  • Editorial Team
    Editorial Team added an answer Put this on line 2: curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); May 13, 2026 at 6:37 am
  • Editorial Team
    Editorial Team added an answer I'd go another route. Just add one more level of… May 13, 2026 at 6:37 am

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want use html5's new tag to play a wav file (currently only supported
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I've got a string that has curly quotes in it. I'd like to replace
In order to apply a triggered animation to all ToolTip s in my app,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.