Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

I am attempting to post some simple data to a aspx page. I am new to AngularJS and was curious to know if this is possible. below is the .JS but I cannot seem to retrieve the data in the code behind. What is the syntax to retrieve post data within a web forms page?

   $scope.TestPost = function () {
        $http({
            url: "index.aspx",
            type: "POST",
            data: { test: 'Tom' },


        }).success(function (data) { alert(data) });

    };

here is my server side code. The request returns null

  protected void Page_Load(object sender, EventArgs e)
        {
          string s=  Request.Form["test"];
        }
share|improve this question
    
Look at the HTTP request in your browser's networking tools. What's the status code for the response? – mason Jul 24 '15 at 20:00

Normally, you can retrieve it from the Form.

protected void Page_Load(object sender, EventArgs e)
{
    string test = Request.Form["test"];
}
share|improve this answer
    
I did try that, but it came back empty each time. Here is what I used. protected void Page_Load(object sender, EventArgs e) { string s= Request.Form["test"]; } – Idget Jul 24 '15 at 19:44
    
Could you show me the fiddler session that angularjs is posted? – Win Jul 24 '15 at 20:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.