retrieve the data posted using the send method of the XmlHttpRequest object on server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hemangajit
    New Member
    • Aug 2008
    • 2

    retrieve the data posted using the send method of the XmlHttpRequest object on server

    Hi,
    I am developing a Asp.NET application which makes use of AJAX for some of the database updation operations. In one case I am posting the data I want to process on the server side using the send method of XmlHttpRequest object. How can I retrieve the data on server side? Below is a sample code I am using

    request.open("P OST", "Default.aspx") ;
    request.send("n ame=" + encodeURI(input Value);

    How can I retrieve the inputValue on server side. Please help.

    Hemangajit
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    You've not closed the send() method call properly (missing a closing bracket).

    Normally, it's dealt with in the same manner as a normal non-Ajax POST request, though I'm not sure about .NET.

    Since this is a server-related question, I've moved it to the .NET forum.

    Comment

    • Curtis Rutland
      Recognized Expert Specialist
      • Apr 2008
      • 3264

      #3
      You can add a HiddenValue to your form. Set it's value on Page_Load or whatever. Then you can get that value in your client side code.

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Originally posted by hemangajit
        Hi,
        I am developing a Asp.NET application which makes use of AJAX for some of the database updation operations. In one case I am posting the data I want to process on the server side using the send method of XmlHttpRequest object. How can I retrieve the data on server side? Below is a sample code I am using

        request.open("P OST", "Default.aspx") ;
        request.send("n ame=" + encodeURI(input Value);

        How can I retrieve the inputValue on server side. Please help.

        Hemangajit

        Once you fix your missing ")" from your request.send... you should be able to access your "name" variable through the Query String on the Server.

        -Frinny

        Comment

        Working...