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

Asked

Viewed 174 times

1

I have a form template that I want the customer to use to paste on your page.

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

At the Page_load event in mine. aspx I want to get the fields filled form via post, however the four options below 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?

1 answer

1


I found the problem.

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

So:

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

If I give Ubmit this and in my . aspx look for:

Request["meucampo"]

Will return void.

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

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.