ASP.NET - .aspx does not receive fields from the form post cross domain

1

I have a form template that I want the client to use to paste onto your page.

The form points to a .aspx page on my server.

In the Page_Load event in my .aspx I want to get the fields filled out of the form via post, however, the following four options return empty (the first) or null array (the following three):

    var a = HttpContext.Current.Request.Form;
    var b = Request.Form[Constantes.EngageFormParams.EnrollmentKey];
    var c = Request[Constantes.EngageFormParams.EnrollmentKey];
    var d = Request[Constantes.EngageFormParams.Login];

If I use method = 'get' it works. How to make the post work?

    
asked by anonymous 29.03.2017 / 20:17

1 answer

1

I discovered the problem.

.aspx pages are based on the "name" attribute to get the value of the field.

Then:

<input type="text" id="meucampo" value="oi"/>

If I submit this, and in my .aspx search for:

Request["meucampo"]

It will return null.

However, if I put the name attribute, it will work as expected for any of the ways to read the request fields that I put in the question.

<input type="text" id="meucampo" name="meucampo" value="oi"/>
    
29.03.2017 / 21:39